diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-05-07 14:12:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-07 20:55:33 +0200 |
commit | e35d97c96139b836d71abd486644f2d576288e8c (patch) | |
tree | 6ec8e8d63e745dee00c3b1a56e9a33bdc0ccd389 /framework | |
parent | 825066456efcad3d160bfc08dde5f2f2eaa7850a (diff) |
osl::Mutex->std::mutex in framework::StatusBarManager
Change-Id: I34cdb5ce7e9e5b3c3d8f985057bb7ff09f2b7f68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133978
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/uielement/statusbarmanager.hxx | 7 | ||||
-rw-r--r-- | framework/source/uielement/statusbarmanager.cxx | 15 |
2 files changed, 13 insertions, 9 deletions
diff --git a/framework/inc/uielement/statusbarmanager.hxx b/framework/inc/uielement/statusbarmanager.hxx index 99cf94ea1d59..ba2dbd9a31c0 100644 --- a/framework/inc/uielement/statusbarmanager.hxx +++ b/framework/inc/uielement/statusbarmanager.hxx @@ -26,10 +26,11 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase.hxx> -#include <comphelper/multicontainer2.hxx> +#include <comphelper/interfacecontainer4.hxx> #include <vcl/status.hxx> #include <vcl/vclptr.hxx> #include <map> +#include <mutex> namespace framework { @@ -92,8 +93,8 @@ class StatusBarManager final: public ::cppu::WeakImplHelper< VclPtr<StatusBar> m_pStatusBar; css::uno::Reference< css::frame::XFrame > m_xFrame; StatusBarControllerMap m_aControllerMap; - osl::Mutex m_mutex; - comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener + std::mutex m_mutex; + comphelper::OInterfaceContainerHelper4<XEventListener> m_aListenerContainer; css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::frame::XUIControllerFactory > m_xStatusbarControllerFactory; }; diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx index 929afb24ca94..b54f57ff098f 100644 --- a/framework/source/uielement/statusbarmanager.cxx +++ b/framework/source/uielement/statusbarmanager.cxx @@ -128,7 +128,6 @@ StatusBarManager::StatusBarManager( m_bUpdateControllers( false ), m_pStatusBar( pStatusBar ), m_xFrame( rFrame ), - m_aListenerContainer( m_mutex ), m_xContext( rxContext ) { @@ -177,9 +176,11 @@ void SAL_CALL StatusBarManager::dispose() { uno::Reference< lang::XComponent > xThis(this ); - lang::EventObject aEvent( xThis ); - m_aListenerContainer.disposeAndClear( aEvent ); - + { + lang::EventObject aEvent( xThis ); + std::unique_lock aGuard(m_mutex); + m_aListenerContainer.disposeAndClear( aGuard, aEvent ); + } { SolarMutexGuard g; if ( m_bDisposed ) @@ -223,12 +224,14 @@ void SAL_CALL StatusBarManager::addEventListener( const uno::Reference< lang::XE if ( m_bDisposed ) throw lang::DisposedException(); - m_aListenerContainer.addInterface( cppu::UnoType<lang::XEventListener>::get(), xListener ); + std::unique_lock aGuard(m_mutex); + m_aListenerContainer.addInterface( aGuard, xListener ); } void SAL_CALL StatusBarManager::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) { - m_aListenerContainer.removeInterface( cppu::UnoType<lang::XEventListener>::get(), xListener ); + std::unique_lock aGuard(m_mutex); + m_aListenerContainer.removeInterface( aGuard, xListener ); } // XUIConfigurationListener |