framework/source/uiconfiguration/windowstateconfiguration.cxx |   17 ++++------
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 058c64ad17ef8ed0d7f583a804368aa8d0071e59
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Dec 24 20:54:15 2021 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sun Dec 26 08:21:59 2021 +0100

    use comphelper::WeakComponentImplHelper in WindowStateConfiguration
    
    Change-Id: Iada515ab1926aa1e0b7a3f39690d7c6eebf28aea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127465
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

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 <com/sun/star/util/XChangesBatch.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 
-#include <cppuhelper/basemutex.hxx>
-#include <cppuhelper/compbase.hxx>
+#include <comphelper/compbase.hxx>
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <comphelper/propertysequence.hxx>
@@ -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() );

Reply via email to