diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-24 20:52:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-25 18:14:05 +0100 |
commit | a7a1d8647a8e03675746d4cbbcf707422f4db888 (patch) | |
tree | 5a5995735b904764f15f556bc3b3fbcaa353e016 /framework | |
parent | 37106f20bd5cc016a473fbdb2e9e37da096cff5f (diff) |
use comphelper::WeakComponentImplHelper in ModuleUIConfigurationManagerSupplier
Change-Id: I22164080dd87ab3c3a93b50d06cba8574e00c189
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127464
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uiconfiguration/moduleuicfgsupplier.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/framework/source/uiconfiguration/moduleuicfgsupplier.cxx b/framework/source/uiconfiguration/moduleuicfgsupplier.cxx index f28c2afedddf..cdbd647c3108 100644 --- a/framework/source/uiconfiguration/moduleuicfgsupplier.cxx +++ b/framework/source/uiconfiguration/moduleuicfgsupplier.cxx @@ -31,8 +31,7 @@ #include <com/sun/star/ui/XModuleUIConfigurationManager2.hpp> #include <com/sun/star/frame/XModuleManager2.hpp> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <unordered_map> @@ -49,13 +48,12 @@ using namespace framework; namespace { -typedef cppu::WeakComponentImplHelper< +typedef comphelper::WeakComponentImplHelper< css::lang::XServiceInfo, css::ui::XModuleUIConfigurationManagerSupplier > ModuleUIConfigurationManagerSupplier_BASE; -class ModuleUIConfigurationManagerSupplier : private cppu::BaseMutex, - public ModuleUIConfigurationManagerSupplier_BASE +class ModuleUIConfigurationManagerSupplier : public ModuleUIConfigurationManagerSupplier_BASE { public: explicit ModuleUIConfigurationManagerSupplier( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); @@ -80,7 +78,7 @@ public: virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager( const OUString& ModuleIdentifier ) override; private: - virtual void SAL_CALL disposing() final override; + virtual void disposing(std::unique_lock<std::mutex>&) final override; typedef std::unordered_map< OUString, css::uno::Reference< css::ui::XModuleUIConfigurationManager2 > > ModuleToModuleCfgMgr; @@ -92,8 +90,7 @@ private: }; ModuleUIConfigurationManagerSupplier::ModuleUIConfigurationManagerSupplier( const Reference< XComponentContext >& xContext ) : - ModuleUIConfigurationManagerSupplier_BASE(m_aMutex) - , m_xModuleMgr( ModuleManager::create( xContext ) ) + m_xModuleMgr( ModuleManager::create( xContext ) ) , m_xContext( xContext ) { try @@ -111,13 +108,12 @@ ModuleUIConfigurationManagerSupplier::ModuleUIConfigurationManagerSupplier( cons ModuleUIConfigurationManagerSupplier::~ModuleUIConfigurationManagerSupplier() { - disposing(); + std::unique_lock g(m_aMutex); + disposing(g); } -void SAL_CALL ModuleUIConfigurationManagerSupplier::disposing() +void ModuleUIConfigurationManagerSupplier::disposing(std::unique_lock<std::mutex>&) { - osl::MutexGuard g(rBHelper.rMutex); - // dispose all our module user interface configuration managers for (auto const& elem : m_aModuleToModuleUICfgMgrMap) { @@ -132,7 +128,7 @@ void SAL_CALL ModuleUIConfigurationManagerSupplier::disposing() // XModuleUIConfigurationManagerSupplier Reference< XUIConfigurationManager > SAL_CALL ModuleUIConfigurationManagerSupplier::getUIConfigurationManager( const OUString& sModuleIdentifier ) { - osl::MutexGuard g(rBHelper.rMutex); + std::unique_lock g(m_aMutex); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ ModuleToModuleCfgMgr::iterator pIter = m_aModuleToModuleUICfgMgrMap.find( sModuleIdentifier ); |