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 /svtools/source/uno/unogridcolumnfacade.cxx | |
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 'svtools/source/uno/unogridcolumnfacade.cxx')
-rwxr-xr-x | svtools/source/uno/unogridcolumnfacade.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx index 00fa72199815..98078b1fb2d4 100755 --- a/svtools/source/uno/unogridcolumnfacade.cxx +++ b/svtools/source/uno/unogridcolumnfacade.cxx @@ -148,6 +148,14 @@ namespace svt { namespace table //------------------------------------------------------------------------------------------------------------------ void SAL_CALL ColumnChangeMultiplexer::columnChanged( const GridColumnEvent& i_event ) throw (RuntimeException) { + if ( i_event.AttributeName.equalsAscii( "DataColumnIndex" ) ) + { + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + if ( m_pColumnImplementation != NULL ) + m_pColumnImplementation->dataColumnIndexChanged(); + return; + } + ColumnAttributeGroup nChangedAttributes( COL_ATTRS_NONE ); if ( i_event.AttributeName.equalsAscii( "HorizontalAlign" ) ) @@ -182,9 +190,11 @@ namespace svt { namespace table UnoGridColumnFacade::UnoGridColumnFacade( UnoControlTableModel const & i_owner, Reference< XGridColumn > const & i_gridColumn ) :m_pOwner( &i_owner ) ,m_xGridColumn( i_gridColumn, UNO_QUERY_THROW ) + ,m_nDataColumnIndex( -1 ) ,m_pChangeMultiplexer( new ColumnChangeMultiplexer( *this ) ) { m_xGridColumn->addGridColumnListener( m_pChangeMultiplexer.get() ); + impl_updateDataColumnIndex_nothrow(); } //------------------------------------------------------------------------------------------------------------------ @@ -206,6 +216,30 @@ namespace svt { namespace table } //------------------------------------------------------------------------------------------------------------------ + void UnoGridColumnFacade::impl_updateDataColumnIndex_nothrow() + { + m_nDataColumnIndex = -1; + ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" ); + try + { + m_nDataColumnIndex = m_xGridColumn->getDataColumnIndex(); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + //------------------------------------------------------------------------------------------------------------------ + void UnoGridColumnFacade::dataColumnIndexChanged() + { + DBG_TESTSOLARMUTEX(); + impl_updateDataColumnIndex_nothrow(); + if ( m_pOwner != NULL ) + m_pOwner->notifyAllDataChanged(); + } + + //------------------------------------------------------------------------------------------------------------------ void UnoGridColumnFacade::columnChanged( ColumnAttributeGroup const i_attributeGroup ) { DBG_TESTSOLARMUTEX(); |