From 058c64ad17ef8ed0d7f583a804368aa8d0071e59 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 24 Dec 2021 20:54:15 +0200 Subject: use comphelper::WeakComponentImplHelper in WindowStateConfiguration Change-Id: Iada515ab1926aa1e0b7a3f39690d7c6eebf28aea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127465 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../source/uiconfiguration/windowstateconfiguration.cxx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'framework/source/uiconfiguration') diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx index cc6f72f36a11..acb0ae059ff9 100644 --- a/framework/source/uiconfiguration/windowstateconfiguration.cxx +++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx @@ -36,8 +36,7 @@ #include #include -#include -#include +#include #include #include #include @@ -1222,11 +1221,10 @@ void ConfigurationAccess_WindowState::impl_initializeConfigAccess() } } -typedef ::cppu::WeakComponentImplHelper< css::container::XNameAccess, +typedef comphelper::WeakComponentImplHelper< css::container::XNameAccess, css::lang::XServiceInfo> WindowStateConfiguration_BASE; -class WindowStateConfiguration : private cppu::BaseMutex, - public WindowStateConfiguration_BASE +class WindowStateConfiguration : public WindowStateConfiguration_BASE { public: explicit WindowStateConfiguration( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); @@ -1271,7 +1269,6 @@ private: }; WindowStateConfiguration::WindowStateConfiguration( const Reference< XComponentContext >& rxContext ) : - WindowStateConfiguration_BASE(m_aMutex), m_xContext( rxContext ) { css::uno::Reference< css::frame::XModuleManager2 > xModuleManager = @@ -1317,14 +1314,14 @@ WindowStateConfiguration::WindowStateConfiguration( const Reference< XComponentC WindowStateConfiguration::~WindowStateConfiguration() { - osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); + std::unique_lock g(m_aMutex); m_aModuleToFileHashMap.clear(); m_aModuleToWindowStateHashMap.clear(); } Any SAL_CALL WindowStateConfiguration::getByName( const OUString& aModuleIdentifier ) { - osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); + std::unique_lock g(m_aMutex); ModuleToWindowStateFileMap::const_iterator pIter = m_aModuleToFileHashMap.find( aModuleIdentifier ); if ( pIter != m_aModuleToFileHashMap.end() ) @@ -1353,14 +1350,14 @@ Any SAL_CALL WindowStateConfiguration::getByName( const OUString& aModuleIdentif Sequence< OUString > SAL_CALL WindowStateConfiguration::getElementNames() { - osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); + std::unique_lock g(m_aMutex); return comphelper::mapKeysToSequence( m_aModuleToFileHashMap ); } sal_Bool SAL_CALL WindowStateConfiguration::hasByName( const OUString& aName ) { - osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); + std::unique_lock g(m_aMutex); ModuleToWindowStateFileMap::const_iterator pIter = m_aModuleToFileHashMap.find( aName ); return ( pIter != m_aModuleToFileHashMap.end() ); -- cgit