summaryrefslogtreecommitdiff
path: root/toolkit/source/controls/grid/defaultgriddatamodel.cxx
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-03 23:14:55 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-03 23:14:55 +0100
commitb83e7371c47c0cf5373ec6e99efe05f9a4da09f5 (patch)
treeb8b0e6eff4a38ec9c89f01ddcafe53f293bc81d5 /toolkit/source/controls/grid/defaultgriddatamodel.cxx
parentcb2f6f86c9de551b806f20e68c50e4037ec51590 (diff)
gridsort: allow cloning grid columns, and the (default) grid data/column model
Diffstat (limited to 'toolkit/source/controls/grid/defaultgriddatamodel.cxx')
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.cxx472
1 files changed, 243 insertions, 229 deletions
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
index 6adf7b994035..eb6f777c3b41 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
@@ -45,301 +45,315 @@ using namespace ::com::sun::star::lang;
#define ROWUPDATED ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowUpdated" ))
#define ROWHEADERWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeaderWidth" ))
+//......................................................................................................................
namespace toolkit
+//......................................................................................................................
{
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::util::XCloneable;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= DefaultGridDataModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::DefaultGridDataModel()
+ :m_nRowHeight(0)
+ ,m_aRowHeaders()
+ ,m_nRowHeaderWidth(10)
+ {
+ }
-///////////////////////////////////////////////////////////////////////
-// class DefaultGridDataModel
-///////////////////////////////////////////////////////////////////////
-
-DefaultGridDataModel::DefaultGridDataModel()
-: rowHeight(0),
- rowHeaders(std::vector< ::rtl::OUString >()),
- m_nRowHeaderWidth(10)
-{
-}
-
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::DefaultGridDataModel( DefaultGridDataModel const & i_copySource )
+ :m_nRowHeight( i_copySource.m_nRowHeight )
+ ,m_aData( i_copySource.m_aData )
+ ,m_aRowHeaders( i_copySource.m_aRowHeaders )
+ ,m_nRowHeaderWidth( i_copySource.m_nRowHeaderWidth )
+ {
+ }
-DefaultGridDataModel::~DefaultGridDataModel()
-{
-}
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::~DefaultGridDataModel()
+ {
+ }
-void DefaultGridDataModel::broadcast( broadcast_type eType, const GridDataEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException)
-{
- ::cppu::OInterfaceContainerHelper* pIter = BrdcstHelper.getContainer( XGridDataListener::static_type() );
- if( pIter )
+ //------------------------------------------------------------------------------------------------------------------
+ void DefaultGridDataModel::broadcast( broadcast_type eType, const GridDataEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException)
{
- ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
- while(aListIter.hasMoreElements())
+ ::cppu::OInterfaceContainerHelper* pIter = BrdcstHelper.getContainer( XGridDataListener::static_type() );
+ if( pIter )
{
- XGridDataListener* pListener = static_cast<XGridDataListener*>(aListIter.next());
- switch( eType )
+ ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
+ while(aListIter.hasMoreElements())
{
- case row_added: pListener->rowAdded(aEvent); break;
- case row_removed: pListener->rowRemoved(aEvent); break;
- case data_changed: pListener->dataChanged(aEvent); break;
+ XGridDataListener* pListener = static_cast<XGridDataListener*>(aListIter.next());
+ switch( eType )
+ {
+ case row_added: pListener->rowAdded(aEvent); break;
+ case row_removed: pListener->rowRemoved(aEvent); break;
+ case data_changed: pListener->dataChanged(aEvent); break;
+ }
}
}
}
-}
-//---------------------------------------------------------------------
-
-void DefaultGridDataModel::broadcast_changed( ::rtl::OUString name, sal_Int32 index, Any oldValue, Any newValue) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridDataEvent aEvent( xSource, name, oldValue, newValue, index, ::rtl::OUString(), Sequence< Any >());
- broadcast( data_changed, aEvent);
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void DefaultGridDataModel::broadcast_changed( ::rtl::OUString name, sal_Int32 index, Any oldValue, Any newValue) throw (::com::sun::star::uno::RuntimeException)
+ {
+ Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridDataEvent aEvent( xSource, name, oldValue, newValue, index, ::rtl::OUString(), Sequence< Any >());
+ broadcast( data_changed, aEvent);
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void DefaultGridDataModel::broadcast_add( sal_Int32 index, const ::rtl::OUString & headerName,
+ ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, (const ::com::sun::star::uno::Sequence< Any >&)rowData );
+ broadcast( row_added, aEvent);
+ }
-void DefaultGridDataModel::broadcast_add( sal_Int32 index, const ::rtl::OUString & headerName,
- ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, (const ::com::sun::star::uno::Sequence< Any >&)rowData );
- broadcast( row_added, aEvent);
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void DefaultGridDataModel::broadcast_remove( sal_Int32 index, const ::rtl::OUString & headerName,
+ ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, rowData );
+ broadcast( row_removed, aEvent);
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeight() throw (::com::sun::star::uno::RuntimeException)
+ {
+ return m_nRowHeight;
+ }
-void DefaultGridDataModel::broadcast_remove( sal_Int32 index, const ::rtl::OUString & headerName,
- ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, rowData );
- broadcast( row_removed, aEvent);
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::setRowHeight(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ sal_Int32 oldValue = m_nRowHeight;
+ m_nRowHeight = value;
-//---------------------------------------------------------------------
+ broadcast_changed( ROWHEIGHT, 0, Any(oldValue), Any(value));
+ }
-//---------------------------------------------------------------------
-// XDefaultGridDataModel
-//---------------------------------------------------------------------
-::sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeight() throw (::com::sun::star::uno::RuntimeException)
-{
- return rowHeight;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridDataModel::getRowCount() throw (::com::sun::star::uno::RuntimeException)
+ {
+ return m_aData.size();
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getRowHeaders() throw (::com::sun::star::uno::RuntimeException)
+ {
+ return comphelper::containerToSequence(m_aRowHeaders);
+ }
-void SAL_CALL DefaultGridDataModel::setRowHeight(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 oldValue = rowHeight;
- rowHeight = value;
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::setRowHeaders(const ::com::sun::star::uno::Sequence< ::rtl::OUString > & i_rowHeaders ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > oldValue( comphelper::containerToSequence( m_aRowHeaders ) );
- broadcast_changed( ROWHEIGHT, 0, Any(oldValue), Any(value));
-}
+ const sal_Int32 sequenceSize = i_rowHeaders.getLength();
-//---------------------------------------------------------------------
+ sal_Int32 i = 0;
+ for ( std::vector< rtl::OUString >::iterator iterator = m_aRowHeaders.begin();
+ iterator != m_aRowHeaders.end();
+ ++iterator, ++i
+ )
+ {
+ if ( sequenceSize > i )
+ *iterator = i_rowHeaders[i];
+ else
+ *iterator = ::rtl::OUString();
+ }
-::sal_Int32 SAL_CALL DefaultGridDataModel::getRowCount() throw (::com::sun::star::uno::RuntimeException)
-{
- return data.size();
-}
+ broadcast_changed( ROWHEADERS, 0, Any( oldValue ), Any( comphelper::containerToSequence( m_aRowHeaders ) ) );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::addRow(const ::rtl::OUString & headername, const ::com::sun::star::uno::Sequence< Any > & rRowdata) throw (::com::sun::star::uno::RuntimeException)
+ {
+ // store header name
+ m_aRowHeaders.push_back(headername);
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getRowHeaders() throw (::com::sun::star::uno::RuntimeException)
-{
- return comphelper::containerToSequence(rowHeaders);
-}
+ // store row m_aData
+ std::vector< Any > newRow;
+ for ( int i = 0; i < rRowdata.getLength();i++)
+ {
+ newRow.push_back(rRowdata[i]);
+ }
-//---------------------------------------------------------------------
+ m_aData.push_back( newRow );
-void SAL_CALL DefaultGridDataModel::setRowHeaders(const ::com::sun::star::uno::Sequence< ::rtl::OUString > & i_rowHeaders ) throw (::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > oldValue( comphelper::containerToSequence( rowHeaders ) );
+ broadcast_add( m_aData.size()-1, headername, comphelper::containerToSequence(newRow));
- const sal_Int32 sequenceSize = i_rowHeaders.getLength();
+ }
- sal_Int32 i = 0;
- for ( std::vector< rtl::OUString >::iterator iterator = rowHeaders.begin();
- iterator != rowHeaders.end();
- ++iterator, ++i
- )
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
{
- if ( sequenceSize > i )
- *iterator = i_rowHeaders[i];
+ if ( index >= 0 && index <= getRowCount()-1)
+ {
+ ::rtl::OUString headerName( (::rtl::OUString) m_aRowHeaders[index] );
+ m_aRowHeaders.erase(m_aRowHeaders.begin() + index);
+
+ Sequence< Any >& rowData ( (Sequence< Any >&)m_aData[index] );
+ m_aData.erase(m_aData.begin() + index);
+ broadcast_remove( index, headerName, rowData);
+ }
else
- *iterator = ::rtl::OUString();
+ return;
}
- broadcast_changed( ROWHEADERS, 0, Any( oldValue ), Any( comphelper::containerToSequence( rowHeaders ) ) );
-}
-
-//---------------------------------------------------------------------
-
-void SAL_CALL DefaultGridDataModel::addRow(const ::rtl::OUString & headername, const ::com::sun::star::uno::Sequence< Any > & rRowdata) throw (::com::sun::star::uno::RuntimeException)
-{
- // store header name
- rowHeaders.push_back(headername);
-
- // store row data
- std::vector< Any > newRow;
- for ( int i = 0; i < rRowdata.getLength();i++)
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Any > > SAL_CALL DefaultGridDataModel::getData() throw (::com::sun::star::uno::RuntimeException)
{
- newRow.push_back(rRowdata[i]);
- }
- data.push_back( newRow );
+ std::vector< std::vector< Any > >::iterator iterator;
+ std::vector< Sequence< Any > > dummyContainer(0);
- broadcast_add( data.size()-1, headername, comphelper::containerToSequence(newRow));
-}
+ for(iterator = m_aData.begin(); iterator != m_aData.end(); iterator++)
+ {
+ Sequence< Any > cols(comphelper::containerToSequence(*iterator));
+ dummyContainer.push_back( cols );
+ }
+ Sequence< Sequence< Any > > dataSequence(comphelper::containerToSequence(dummyContainer));
-//---------------------------------------------------------------------
+ return dataSequence;
+ }
-void SAL_CALL DefaultGridDataModel::removeRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- if ( index >= 0 && index <= getRowCount()-1)
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::addGridDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
{
- ::rtl::OUString headerName( (::rtl::OUString) rowHeaders[index] );
- rowHeaders.erase(rowHeaders.begin() + index);
-
- Sequence< Any >& rowData ( (Sequence< Any >&)data[index] );
- data.erase(data.begin() + index);
- broadcast_remove( index, headerName, rowData);
+ BrdcstHelper.addListener( XGridDataListener::static_type(), xListener );
}
- else
- return;
-}
-//---------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Any > > SAL_CALL DefaultGridDataModel::getData() throw (::com::sun::star::uno::RuntimeException)
-{
-
- std::vector< std::vector< Any > >::iterator iterator;
- std::vector< Sequence< Any > > dummyContainer(0);
-
- for(iterator = data.begin(); iterator != data.end(); iterator++)
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeGridDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
{
- Sequence< Any > cols(comphelper::containerToSequence(*iterator));
- dummyContainer.push_back( cols );
+ BrdcstHelper.removeListener( XGridDataListener::static_type(), xListener );
}
- Sequence< Sequence< Any > > dataSequence(comphelper::containerToSequence(dummyContainer));
-
- return dataSequence;
-}
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeAll() throw (RuntimeException)
+ {
+ m_aRowHeaders.clear();
+ m_aData.clear();
+ broadcast_remove( -1, ::rtl::OUString(), 0);
+ }
-void SAL_CALL DefaultGridDataModel::addGridDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XGridDataListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ sal_Int32 oldValue = m_nRowHeaderWidth;
+ m_nRowHeaderWidth = _value;
+ broadcast_changed( ROWHEADERWIDTH, 0, Any(oldValue), Any(_value) );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeaderWidth() throw (::com::sun::star::uno::RuntimeException)
+ {
+ return m_nRowHeaderWidth;
+ }
-void SAL_CALL DefaultGridDataModel::removeGridDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XGridDataListener::static_type(), xListener );
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::removeAll() throw (RuntimeException)
-{
- rowHeaders.clear();
- data.clear();
- broadcast_remove( -1, ::rtl::OUString(), 0);
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 oldValue = m_nRowHeaderWidth;
- m_nRowHeaderWidth = _value;
- broadcast_changed( ROWHEADERWIDTH, 0, Any(oldValue), Any(_value) );
-}
-//---------------------------------------------------------------------
-sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeaderWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- return m_nRowHeaderWidth;
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::updateCell(::sal_Int32 row, ::sal_Int32 column, const Any& value) throw (::com::sun::star::uno::RuntimeException)
-{
- if(row >= 0 && row < (signed)data.size())
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateCell(::sal_Int32 row, ::sal_Int32 column, const Any& value) throw (::com::sun::star::uno::RuntimeException)
{
- if(column >= 0 && column < (signed)data[0].size())
+ if(row >= 0 && row < (signed)m_aData.size())
{
- data[row][column] = value;
- Sequence< Any >dataSeq(comphelper::containerToSequence(data[row]));
- broadcast_changed( CELLUPDATED, row, Any(column), value );
+ if(column >= 0 && column < (signed)m_aData[0].size())
+ {
+ m_aData[row][column] = value;
+ Sequence< Any >dataSeq(comphelper::containerToSequence(m_aData[row]));
+ broadcast_changed( CELLUPDATED, row, Any(column), value );
+ }
}
}
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::updateRow(::sal_Int32 row, const ::com::sun::star::uno::Sequence< ::sal_Int32 > & columns, const ::com::sun::star::uno::Sequence< Any > & values) throw (::com::sun::star::uno::RuntimeException)
-{
- if(row >= 0 && row < (signed)data.size())
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateRow(::sal_Int32 row, const ::com::sun::star::uno::Sequence< ::sal_Int32 > & columns, const ::com::sun::star::uno::Sequence< Any > & values) throw (::com::sun::star::uno::RuntimeException)
{
- if(columns.getLength() == values.getLength())
+ if(row >= 0 && row < (signed)m_aData.size())
{
- for(int i = 0; i < columns.getLength(); i++)
- data[row][i] = values[i];
- Sequence< Any >dataSeq(comphelper::containerToSequence(data[row]));
- broadcast_changed( ROWUPDATED, row, Any(columns), Any(values) );
+ if(columns.getLength() == values.getLength())
+ {
+ for(int i = 0; i < columns.getLength(); i++)
+ m_aData[row][i] = values[i];
+ Sequence< Any >dataSeq(comphelper::containerToSequence(m_aData[row]));
+ broadcast_changed( ROWUPDATED, row, Any(columns), Any(values) );
+ }
}
}
-}
-//---------------------------------------------------------------------
-// XComponent
-//---------------------------------------------------------------------
-
-void SAL_CALL DefaultGridDataModel::dispose() throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- ::com::sun::star::lang::EventObject aEvent;
- aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
- BrdcstHelper.aLC.disposeAndClear( aEvent );
-
-}
-
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::dispose() throw (RuntimeException)
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-void SAL_CALL DefaultGridDataModel::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XEventListener::static_type(), xListener );
-}
+ ::com::sun::star::lang::EventObject aEvent;
+ aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
+ BrdcstHelper.aLC.disposeAndClear( aEvent );
-//---------------------------------------------------------------------
+ }
-void SAL_CALL DefaultGridDataModel::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
-}
-//---------------------------------------------------------------------
-// XServiceInfo
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
+ {
+ BrdcstHelper.addListener( XEventListener::static_type(), xListener );
+ }
-::rtl::OUString SAL_CALL DefaultGridDataModel::getImplementationName( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridDataModel" ) );
- return aImplName;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
+ {
+ BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL DefaultGridDataModel::getImplementationName( ) throw (RuntimeException)
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridDataModel" ) );
+ return aImplName;
+ }
-sal_Bool SAL_CALL DefaultGridDataModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return ServiceName.equalsAscii( szServiceName_DefaultGridDataModel );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL DefaultGridDataModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ return ServiceName.equalsAscii( szServiceName_DefaultGridDataModel );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridDataModel ) );
+ static const Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+ }
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getSupportedServiceNames( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridDataModel ) );
- static const Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XCloneable > SAL_CALL DefaultGridDataModel::createClone( ) throw (RuntimeException)
+ {
+ return new DefaultGridDataModel( *this );
+ }
-}
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
Reference< XInterface > SAL_CALL DefaultGridDataModel_CreateInstance( const Reference< XMultiServiceFactory >& )
{