summaryrefslogtreecommitdiff
path: root/toolkit/source/controls/grid
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-06 14:16:36 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-06 14:16:36 +0100
commitadebaa24f8ee734ed5694feee1ba225b4b1dcf95 (patch)
treef5d070a65efda85897aae1493a345eb6ff33819c /toolkit/source/controls/grid
parent40fa25aad018cb9c31aa78f7e2c9634f796e0a04 (diff)
gridsort: allow inserting columns into the column model while the control is already alive (unfinished)
Missing: Adjustments to the data model. Probably we need to change the API here: It does not make sense that the only method to retrieve actual data from the data model is "any[][] getData" - this doesn't scale at all, and blocks all dynamic changes to the columns. I suppose we need some "any getCellData( col, row )" here.
Diffstat (limited to 'toolkit/source/controls/grid')
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
index 8537a03321aa..34d610ef5661 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
@@ -119,12 +119,20 @@ namespace toolkit
//------------------------------------------------------------------------------------------------------------------
::sal_Int32 SAL_CALL DefaultGridColumnModel::addColumn( const Reference< XGridColumn > & i_column ) throw (RuntimeException)
{
- ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex );
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
m_aColumns.push_back( i_column );
sal_Int32 index = m_aColumns.size() - 1;
i_column->setIndex( index );
+ // fire insertion notifications
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Accessor <<= index;
+ aEvent.Element <<= i_column;
+ aGuard.clear();
+ m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent );
+
return index;
}