diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-01-19 12:39:41 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-01-19 12:39:41 +0100 |
commit | 903ddf534a9a71cb54867d7c40eedf456acb018a (patch) | |
tree | 6950546524d2bd9af234fa1a4d16aea741afa475 /toolkit/source/controls | |
parent | e8f649b5ad64a2a3f07dfab1a52033d126da211b (diff) |
gridsort: introduce XGridColumn::DataModelIndex. this allows for column removal/insertion at the GridColumnModel, without the need to touch the GridDataModel
Diffstat (limited to 'toolkit/source/controls')
-rw-r--r-- | toolkit/source/controls/grid/defaultgridcolumnmodel.cxx | 1 | ||||
-rw-r--r-- | toolkit/source/controls/grid/gridcolumn.cxx | 15 | ||||
-rw-r--r-- | toolkit/source/controls/grid/gridcolumn.hxx | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx index 80d1c9c136d3..8c50a7e62ef7 100644 --- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx +++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx @@ -234,6 +234,7 @@ namespace toolkit colTitle.append( i + 1 ); pGridColumn->setTitle( colTitle.makeStringAndClear() ); pGridColumn->setPreferredWidth( 80 /* APPFONT */ ); + pGridColumn->setDataColumnIndex( i ); ContainerEvent aEvent; aEvent.Source = *this; diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx index 99ea4e68ce8d..60873cc1802f 100644 --- a/toolkit/source/controls/grid/gridcolumn.cxx +++ b/toolkit/source/controls/grid/gridcolumn.cxx @@ -50,6 +50,7 @@ namespace toolkit :GridColumn_Base( m_aMutex ) ,m_aIdentifier() ,m_nIndex(-1) + ,m_nDataColumnIndex(-1) ,m_nColumnWidth(4) ,m_nPreferredWidth(0) ,m_nMaxWidth(0) @@ -65,6 +66,7 @@ namespace toolkit ,GridColumn_Base( m_aMutex ) ,m_aIdentifier( i_copySource.m_aIdentifier ) ,m_nIndex( -1 ) + ,m_nDataColumnIndex( i_copySource.m_nDataColumnIndex ) ,m_nColumnWidth( i_copySource.m_nColumnWidth ) ,m_nPreferredWidth( i_copySource.m_nPreferredWidth ) ,m_nMaxWidth( i_copySource.m_nMaxWidth ) @@ -249,6 +251,19 @@ namespace toolkit } //------------------------------------------------------------------------------------------------------------------ + ::sal_Int32 SAL_CALL GridColumn::getDataColumnIndex() throw(RuntimeException) + { + ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + return m_nDataColumnIndex; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL GridColumn::setDataColumnIndex( ::sal_Int32 i_dataColumnIndex ) throw(RuntimeException) + { + impl_set( m_nDataColumnIndex, i_dataColumnIndex, "DataColumnIndex" ); + } + + //------------------------------------------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL GridColumn::getImplementationName( ) throw (RuntimeException) { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.toolkit.GridColumn" ) ); diff --git a/toolkit/source/controls/grid/gridcolumn.hxx b/toolkit/source/controls/grid/gridcolumn.hxx index 4fbaddb3151b..a28fd5824160 100644 --- a/toolkit/source/controls/grid/gridcolumn.hxx +++ b/toolkit/source/controls/grid/gridcolumn.hxx @@ -73,6 +73,8 @@ public: virtual ::rtl::OUString SAL_CALL getHelpText() throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setHelpText(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getIndex() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getDataColumnIndex() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDataColumnIndex( ::sal_Int32 i_dataColumnIndex ) throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::style::HorizontalAlignment SAL_CALL getHorizontalAlign() throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setHorizontalAlign(::com::sun::star::style::HorizontalAlignment align) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addGridColumnListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); @@ -119,6 +121,7 @@ private: ::com::sun::star::uno::Any m_aIdentifier; sal_Int32 m_nIndex; + sal_Int32 m_nDataColumnIndex; sal_Int32 m_nColumnWidth; sal_Int32 m_nPreferredWidth; sal_Int32 m_nMaxWidth; |