diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-24 20:37:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-27 07:34:29 +0100 |
commit | 174b39754e45f4df0e0123336f3ed298bf81ebc4 (patch) | |
tree | b89bd3a02439f4591797dec3032ba203040982da /toolkit/source/controls/grid/gridcolumn.cxx | |
parent | 5437632edfa35d45b3b91c818f00b8967c5a5888 (diff) |
use comphelper::WeakComponentImplHelper in GridColumn
Change-Id: Ibadee8190f254f8af1f76a69a5671010e6dd0016
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127459
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit/source/controls/grid/gridcolumn.cxx')
-rw-r--r-- | toolkit/source/controls/grid/gridcolumn.cxx | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx index fa2119d434bc..6d94ecb9a72b 100644 --- a/toolkit/source/controls/grid/gridcolumn.cxx +++ b/toolkit/source/controls/grid/gridcolumn.cxx @@ -39,8 +39,7 @@ namespace toolkit GridColumn::GridColumn() - :GridColumn_Base( m_aMutex ) - ,m_nIndex(-1) + :m_nIndex(-1) ,m_nDataColumnIndex(-1) ,m_nColumnWidth(4) ,m_nMaxWidth(0) @@ -53,9 +52,7 @@ namespace toolkit GridColumn::GridColumn( GridColumn const & i_copySource ) - :cppu::BaseMutex() - ,GridColumn_Base( m_aMutex ) - ,m_aIdentifier( i_copySource.m_aIdentifier ) + :m_aIdentifier( i_copySource.m_aIdentifier ) ,m_nIndex( -1 ) ,m_nDataColumnIndex( i_copySource.m_nDataColumnIndex ) ,m_nColumnWidth( i_copySource.m_nColumnWidth ) @@ -76,7 +73,7 @@ namespace toolkit void GridColumn::broadcast_changed( char const * const i_asciiAttributeName, const Any& i_oldValue, const Any& i_newValue, - ::comphelper::ComponentGuard& i_Guard ) + std::unique_lock<std::mutex>& i_Guard ) { Reference< XInterface > const xSource( static_cast< ::cppu::OWeakObject* >( this ) ); GridColumnEvent const aEvent( @@ -84,31 +81,28 @@ namespace toolkit i_oldValue, i_newValue, m_nIndex ); - ::cppu::OInterfaceContainerHelper* pIter = rBHelper.getContainer( cppu::UnoType<XGridColumnListener>::get() ); - - i_Guard.clear(); - if( pIter ) - pIter->notifyEach( &XGridColumnListener::columnChanged, aEvent ); + i_Guard.unlock(); + maGridColumnListeners.notifyEach( &XGridColumnListener::columnChanged, aEvent ); } css::uno::Any SAL_CALL GridColumn::getIdentifier() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_aIdentifier; } void SAL_CALL GridColumn::setIdentifier(const css::uno::Any & value) { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); m_aIdentifier = value; } ::sal_Int32 SAL_CALL GridColumn::getColumnWidth() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_nColumnWidth; } @@ -121,7 +115,7 @@ namespace toolkit ::sal_Int32 SAL_CALL GridColumn::getMaxWidth() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_nMaxWidth; } @@ -134,7 +128,7 @@ namespace toolkit ::sal_Int32 SAL_CALL GridColumn::getMinWidth() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_nMinWidth; } @@ -147,7 +141,7 @@ namespace toolkit OUString SAL_CALL GridColumn::getTitle() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_sTitle; } @@ -160,7 +154,7 @@ namespace toolkit OUString SAL_CALL GridColumn::getHelpText() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_sHelpText; } @@ -173,7 +167,7 @@ namespace toolkit sal_Bool SAL_CALL GridColumn::getResizeable() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_bResizeable; } @@ -186,7 +180,7 @@ namespace toolkit ::sal_Int32 SAL_CALL GridColumn::getFlexibility() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_nFlexibility; } @@ -201,7 +195,7 @@ namespace toolkit HorizontalAlignment SAL_CALL GridColumn::getHorizontalAlign() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_eHorizontalAlign; } @@ -214,19 +208,20 @@ namespace toolkit void SAL_CALL GridColumn::addGridColumnListener( const Reference< XGridColumnListener >& xListener ) { - rBHelper.addListener( cppu::UnoType<XGridColumnListener>::get(), xListener ); + std::unique_lock aGuard( m_aMutex ); + maGridColumnListeners.addInterface( xListener ); } void SAL_CALL GridColumn::removeGridColumnListener( const Reference< XGridColumnListener >& xListener ) { - rBHelper.removeListener( cppu::UnoType<XGridColumnListener>::get(), xListener ); + std::unique_lock aGuard( m_aMutex ); + maGridColumnListeners.removeInterface( xListener ); } - void SAL_CALL GridColumn::disposing() + void GridColumn::disposing(std::unique_lock<std::mutex>&) { - ::osl::MutexGuard aGuard( m_aMutex ); m_aIdentifier.clear(); m_sTitle.clear(); m_sHelpText.clear(); @@ -235,21 +230,21 @@ namespace toolkit ::sal_Int32 SAL_CALL GridColumn::getIndex() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_nIndex; } void GridColumn::setIndex( sal_Int32 const i_index ) { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); m_nIndex = i_index; } ::sal_Int32 SAL_CALL GridColumn::getDataColumnIndex() { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + std::unique_lock aGuard( m_aMutex ); return m_nDataColumnIndex; } |