From adebaa24f8ee734ed5694feee1ba225b4b1dcf95 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 6 Jan 2011 14:16:36 +0100 Subject: 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. --- toolkit/source/controls/grid/defaultgridcolumnmodel.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'toolkit/source/controls/grid') 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; } -- cgit