Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b83e7371
Kaydet (Commit)
b83e7371
authored
14 years ago
tarafından
Frank Schoenheit [fs]
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
gridsort: allow cloning grid columns, and the (default) grid data/column model
üst
cb2f6f86
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
112 additions
and
21 deletions
+112
-21
unocontroltablemodel.cxx
svtools/source/uno/unocontroltablemodel.cxx
+1
-1
defaultgridcolumnmodel.cxx
toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
+38
-11
defaultgridcolumnmodel.hxx
toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
+5
-2
defaultgriddatamodel.cxx
toolkit/source/controls/grid/defaultgriddatamodel.cxx
+0
-0
defaultgriddatamodel.hxx
toolkit/source/controls/grid/defaultgriddatamodel.hxx
+10
-5
gridcolumn.cxx
toolkit/source/controls/grid/gridcolumn.cxx
+23
-1
gridcolumn.hxx
toolkit/source/controls/grid/gridcolumn.hxx
+4
-0
gridcontrol.cxx
toolkit/source/controls/grid/gridcontrol.cxx
+31
-1
No files found.
svtools/source/uno/unocontroltablemodel.cxx
Dosyayı görüntüle @
b83e7371
...
...
@@ -84,7 +84,7 @@ using namespace ::com::sun::star::awt::grid;
//--------------------------------------------------------------------
UnoControlTableColumn
::
UnoControlTableColumn
(
const
Reference
<
XGridColumn
>&
i_gridColumn
)
:
m_nID
(
0
)
,
m_xGridColumn
(
i_gridColumn
,
UNO_
SET
_THROW
)
,
m_xGridColumn
(
i_gridColumn
,
UNO_
QUERY
_THROW
)
{
}
...
...
This diff is collapsed.
Click to expand it.
toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
Dosyayı görüntüle @
b83e7371
...
...
@@ -59,6 +59,7 @@ namespace toolkit
using
::
com
::
sun
::
star
::
container
::
ContainerEvent
;
using
::
com
::
sun
::
star
::
uno
::
Exception
;
using
::
com
::
sun
::
star
::
lang
::
IndexOutOfBoundsException
;
using
::
com
::
sun
::
star
::
util
::
XCloneable
;
/** === end UNO using === **/
//==================================================================================================================
...
...
@@ -74,6 +75,35 @@ namespace toolkit
{
}
//------------------------------------------------------------------------------------------------------------------
DefaultGridColumnModel
::
DefaultGridColumnModel
(
DefaultGridColumnModel
const
&
i_copySource
)
:
DefaultGridColumnModel_Base
(
m_aMutex
)
,
m_aContext
(
i_copySource
.
m_aContext
)
,
m_aContainerListeners
(
m_aMutex
)
,
m_aColumns
()
,
m_nColumnHeaderHeight
(
i_copySource
.
m_nColumnHeaderHeight
)
{
Columns
aColumns
;
aColumns
.
reserve
(
i_copySource
.
m_aColumns
.
size
()
);
try
{
for
(
Columns
::
const_iterator
col
=
i_copySource
.
m_aColumns
.
begin
();
col
!=
i_copySource
.
m_aColumns
.
end
();
++
col
)
{
const
Reference
<
XCloneable
>
xCloneable
(
*
col
,
UNO_QUERY_THROW
);
aColumns
.
push_back
(
Reference
<
XGridColumn
>
(
xCloneable
->
createClone
(),
UNO_QUERY_THROW
)
);
}
}
catch
(
const
Exception
&
)
{
DBG_UNHANDLED_EXCEPTION
();
}
if
(
aColumns
.
size
()
==
i_copySource
.
m_aColumns
.
size
()
)
m_aColumns
.
swap
(
aColumns
);
}
//------------------------------------------------------------------------------------------------------------------
DefaultGridColumnModel
::~
DefaultGridColumnModel
()
{
...
...
@@ -210,18 +240,9 @@ namespace toolkit
}
//------------------------------------------------------------------------------------------------------------------
Reference
<
XGridColumn
>
SAL_CALL
DefaultGridColumnModel
::
copyColumn
(
const
Reference
<
XGridColumn
>
&
column
)
throw
(
RuntimeException
)
Reference
<
XGridColumn
>
SAL_CALL
DefaultGridColumnModel
::
copyColumn
(
const
Reference
<
XGridColumn
>
&
i_column
)
throw
(
RuntimeException
)
{
Reference
<
XGridColumn
>
xColumn
(
m_aContext
.
createComponent
(
"com.sun.star.awt.grid.GridColumn"
),
UNO_QUERY_THROW
);
xColumn
->
setColumnWidth
(
column
->
getColumnWidth
());
xColumn
->
setPreferredWidth
(
column
->
getPreferredWidth
());
xColumn
->
setMaxWidth
(
column
->
getMaxWidth
());
xColumn
->
setMinWidth
(
column
->
getMinWidth
());
xColumn
->
setPreferredWidth
(
column
->
getPreferredWidth
());
xColumn
->
setResizeable
(
column
->
getResizeable
());
xColumn
->
setTitle
(
column
->
getTitle
());
xColumn
->
setHorizontalAlign
(
column
->
getHorizontalAlign
());
return
xColumn
;
return
Reference
<
XGridColumn
>
(
i_column
->
createClone
(),
UNO_QUERY_THROW
);
}
//------------------------------------------------------------------------------------------------------------------
...
...
@@ -293,6 +314,12 @@ namespace toolkit
}
}
//------------------------------------------------------------------------------------------------------------------
Reference
<
XCloneable
>
SAL_CALL
DefaultGridColumnModel
::
createClone
(
)
throw
(
RuntimeException
)
{
return
new
DefaultGridColumnModel
(
*
this
);
}
//......................................................................................................................
}
// namespace toolkit
//......................................................................................................................
...
...
This diff is collapsed.
Click to expand it.
toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
Dosyayı görüntüle @
b83e7371
...
...
@@ -28,7 +28,6 @@
/** === begin UNO includes === **/
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
#include <com/sun/star/awt/grid/XGridColumn.hpp>
//#include <com/sun/star/awt/grid/GridColumnEvent.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
...
...
@@ -54,7 +53,8 @@ class DefaultGridColumnModel :public ::cppu::BaseMutex
,
public
DefaultGridColumnModel_Base
{
public
:
DefaultGridColumnModel
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>&
xFactory
);
DefaultGridColumnModel
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>&
xFactory
);
DefaultGridColumnModel
(
DefaultGridColumnModel
const
&
i_copySource
);
virtual
~
DefaultGridColumnModel
();
// XGridColumnModel
...
...
@@ -76,6 +76,9 @@ public:
virtual
void
SAL_CALL
addContainerListener
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XContainerListener
>&
xListener
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
removeContainerListener
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XContainerListener
>&
xListener
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XCloneable
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
util
::
XCloneable
>
SAL_CALL
createClone
(
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// OComponentHelper
virtual
void
SAL_CALL
disposing
();
...
...
This diff is collapsed.
Click to expand it.
toolkit/source/controls/grid/defaultgriddatamodel.cxx
Dosyayı görüntüle @
b83e7371
This diff is collapsed.
Click to expand it.
toolkit/source/controls/grid/defaultgriddatamodel.hxx
Dosyayı görüntüle @
b83e7371
...
...
@@ -57,6 +57,7 @@ class DefaultGridDataModel : public ::cppu::WeakImplHelper2< XGridDataModel, XSe
{
public
:
DefaultGridDataModel
();
DefaultGridDataModel
(
DefaultGridDataModel
const
&
i_copySource
);
virtual
~
DefaultGridDataModel
();
// XGridDataModel
...
...
@@ -66,7 +67,7 @@ public:
virtual
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
rtl
::
OUString
>
SAL_CALL
getRowHeaders
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
setRowHeaders
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
rtl
::
OUString
>
&
value
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Sequence
<
Any
>
>
SAL_CALL
getData
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
addRow
(
const
::
rtl
::
OUString
&
headername
,
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
Any
>
&
d
ata
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
addRow
(
const
::
rtl
::
OUString
&
headername
,
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
Any
>
&
m_aD
ata
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
removeRow
(
::
sal_Int32
index
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
addGridDataListener
(
const
Reference
<
XGridDataListener
>&
xListener
)
throw
(
RuntimeException
);
virtual
void
SAL_CALL
removeGridDataListener
(
const
Reference
<
XGridDataListener
>&
xListener
)
throw
(
RuntimeException
);
...
...
@@ -75,11 +76,15 @@ public:
virtual
sal_Int32
SAL_CALL
getRowHeaderWidth
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
updateCell
(
::
sal_Int32
row
,
::
sal_Int32
column
,
const
::
com
::
sun
::
star
::
uno
::
Any
&
value
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
updateRow
(
::
sal_Int32
row
,
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
sal_Int32
>&
columns
,
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Any
>&
values
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XComponent
virtual
void
SAL_CALL
dispose
(
)
throw
(
RuntimeException
);
virtual
void
SAL_CALL
addEventListener
(
const
Reference
<
XEventListener
>&
xListener
)
throw
(
RuntimeException
);
virtual
void
SAL_CALL
removeEventListener
(
const
Reference
<
XEventListener
>&
aListener
)
throw
(
RuntimeException
);
// XCloneable
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
util
::
XCloneable
>
SAL_CALL
createClone
(
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XServiceInfo
virtual
::
rtl
::
OUString
SAL_CALL
getImplementationName
(
)
throw
(
RuntimeException
);
virtual
::
sal_Bool
SAL_CALL
supportsService
(
const
::
rtl
::
OUString
&
ServiceName
)
throw
(
RuntimeException
);
...
...
@@ -92,10 +97,10 @@ private:
void
broadcast_add
(
sal_Int32
index
,
const
::
rtl
::
OUString
&
headerName
,
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
Any
>
rowData
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
broadcast_remove
(
sal_Int32
index
,
const
::
rtl
::
OUString
&
headerName
,
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
Any
>
rowData
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
sal_Int32
r
owHeight
;
std
::
vector
<
std
::
vector
<
Any
>
>
d
ata
;
std
::
vector
<
::
rtl
::
OUString
>
r
owHeaders
;
sal_Int32
m_nRowHeaderWidth
;
sal_Int32
m_nR
owHeight
;
std
::
vector
<
std
::
vector
<
Any
>
>
m_aD
ata
;
std
::
vector
<
::
rtl
::
OUString
>
m_aR
owHeaders
;
sal_Int32
m_nRowHeaderWidth
;
};
}
This diff is collapsed.
Click to expand it.
toolkit/source/controls/grid/gridcolumn.cxx
Dosyayı görüntüle @
b83e7371
...
...
@@ -46,11 +46,13 @@ namespace toolkit
using
namespace
::
com
::
sun
::
star
::
awt
;
using
namespace
::
com
::
sun
::
star
::
awt
::
grid
;
using
namespace
::
com
::
sun
::
star
::
lang
;
using
namespace
::
com
::
sun
::
star
::
util
;
using
namespace
::
com
::
sun
::
star
::
style
;
//==================================================================================================================
//= DefaultGridColumnModel
//==================================================================================================================
//------------------------------------------------------------------------------------------------------------------
GridColumn
::
GridColumn
()
:
GridColumn_Base
(
m_aMutex
)
,
m_aIdentifier
()
...
...
@@ -60,7 +62,21 @@ namespace toolkit
,
m_nMaxWidth
(
0
)
,
m_nMinWidth
(
0
)
,
m_bResizeable
(
true
)
,
m_eHorizontalAlign
(
HorizontalAlignment
(
0
))
,
m_eHorizontalAlign
(
HorizontalAlignment_LEFT
)
{
}
//------------------------------------------------------------------------------------------------------------------
GridColumn
::
GridColumn
(
GridColumn
const
&
i_copySource
)
:
GridColumn_Base
(
m_aMutex
)
,
m_aIdentifier
(
i_copySource
.
m_aIdentifier
)
,
m_nIndex
(
i_copySource
.
m_nIndex
)
,
m_nColumnWidth
(
i_copySource
.
m_nColumnWidth
)
,
m_nPreferredWidth
(
i_copySource
.
m_nPreferredWidth
)
,
m_nMaxWidth
(
i_copySource
.
m_nMaxWidth
)
,
m_nMinWidth
(
i_copySource
.
m_nMinWidth
)
,
m_bResizeable
(
i_copySource
.
m_bResizeable
)
,
m_eHorizontalAlign
(
i_copySource
.
m_eHorizontalAlign
)
{
}
...
...
@@ -283,6 +299,12 @@ namespace toolkit
const
Sequence
<
::
rtl
::
OUString
>
aSeq
(
&
aServiceName
,
1
);
return
aSeq
;
}
//------------------------------------------------------------------------------------------------------------------
Reference
<
XCloneable
>
SAL_CALL
GridColumn
::
createClone
(
)
throw
(
RuntimeException
)
{
return
new
GridColumn
(
*
this
);
}
}
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XInterface
>
SAL_CALL
GridColumn_CreateInstance
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>&
)
...
...
This diff is collapsed.
Click to expand it.
toolkit/source/controls/grid/gridcolumn.hxx
Dosyayı görüntüle @
b83e7371
...
...
@@ -51,6 +51,7 @@ class GridColumn :public ::cppu::BaseMutex
{
public
:
GridColumn
();
GridColumn
(
GridColumn
const
&
i_copySource
);
virtual
~
GridColumn
();
// ::com::sun::star::awt::grid::XGridColumn
...
...
@@ -78,6 +79,9 @@ public:
virtual
void
SAL_CALL
addEventListener
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XEventListener
>&
xListener
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
removeEventListener
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XEventListener
>&
aListener
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XCloneable (base of XGridColumn)
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
util
::
XCloneable
>
SAL_CALL
createClone
(
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XServiceInfo
virtual
::
rtl
::
OUString
SAL_CALL
getImplementationName
(
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
::
sal_Bool
SAL_CALL
supportsService
(
const
::
rtl
::
OUString
&
ServiceName
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
This diff is collapsed.
Click to expand it.
toolkit/source/controls/grid/gridcontrol.cxx
Dosyayı görüntüle @
b83e7371
...
...
@@ -92,8 +92,38 @@ UnoGridModel::UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::
//----------------------------------------------------------------------------------------------------------------------
UnoGridModel
::
UnoGridModel
(
const
UnoGridModel
&
rModel
)
:
UnoControlModel
(
rModel
)
:
UnoControlModel
(
rModel
)
{
// clone the data model
const
Reference
<
XFastPropertySet
>
xCloneSource
(
&
const_cast
<
UnoGridModel
&
>
(
rModel
)
);
bool
success
=
false
;
try
{
const
Reference
<
XCloneable
>
xCloneable
(
xCloneSource
->
getFastPropertyValue
(
BASEPROPERTY_GRID_DATAMODEL
),
UNO_QUERY_THROW
);
setFastPropertyValue
(
BASEPROPERTY_GRID_DATAMODEL
,
makeAny
(
xCloneable
->
createClone
()
)
);
success
=
true
;
}
catch
(
const
Exception
&
)
{
DBG_UNHANDLED_EXCEPTION
();
}
if
(
!
success
)
setFastPropertyValue
(
BASEPROPERTY_GRID_DATAMODEL
,
makeAny
(
maContext
.
createComponent
(
"com.sun.star.awt.grid.DefaultGridDataModel"
)
)
);
// clone the column model
success
=
false
;
try
{
const
Reference
<
XCloneable
>
xCloneable
(
xCloneSource
->
getFastPropertyValue
(
BASEPROPERTY_GRID_COLUMNMODEL
),
UNO_QUERY_THROW
);
setFastPropertyValue
(
BASEPROPERTY_GRID_COLUMNMODEL
,
makeAny
(
xCloneable
->
createClone
()
)
);
success
=
true
;
}
catch
(
const
Exception
&
)
{
DBG_UNHANDLED_EXCEPTION
();
}
if
(
!
success
)
setFastPropertyValue
(
BASEPROPERTY_GRID_COLUMNMODEL
,
makeAny
(
maContext
.
createComponent
(
"com.sun.star.awt.grid.DefaultGridColumnModel"
)
)
);
}
//----------------------------------------------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment