include/svtools/acceleratorexecute.hxx     |    3 ++-
 svtools/source/misc/acceleratorexecute.cxx |   28 ++++++++++++++--------------
 2 files changed, 16 insertions(+), 15 deletions(-)

New commits:
commit 6198ea0469d1fca24fe2de2b8ac17bbfd0f3c1b6
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Dec 18 21:07:16 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Dec 20 18:50:59 2021 +0100

    osl::Mutex->std::mutex in AcceleratorExecute
    
    Change-Id: Ib95f4bf1d5f09e8647ce8f35e8165c6858247fd9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127116
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svtools/acceleratorexecute.hxx 
b/include/svtools/acceleratorexecute.hxx
index f43fefe43507..c5c9f4e0b13a 100644
--- a/include/svtools/acceleratorexecute.hxx
+++ b/include/svtools/acceleratorexecute.hxx
@@ -22,6 +22,7 @@
 #include <svtools/svtdllapi.h>
 
 #include <memory>
+#include <mutex>
 
 #include <com/sun/star/awt/KeyEvent.hpp>
 #include <vcl/keycod.hxx>
@@ -65,7 +66,7 @@ class SVT_DLLPUBLIC AcceleratorExecute final
 {
     // member
     private:
-        ::osl::Mutex m_aLock;
+        std::mutex m_aLock;
 
         /** TODO document me */
         css::uno::Reference< css::uno::XComponentContext > m_xContext;
diff --git a/svtools/source/misc/acceleratorexecute.cxx 
b/svtools/source/misc/acceleratorexecute.cxx
index 9fa76e56deaf..8302e7addd43 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -104,7 +104,7 @@ void AcceleratorExecute::init(const css::uno::Reference< 
css::uno::XComponentCon
                               const css::uno::Reference< css::frame::XFrame >& 
             xEnv )
 {
     // SAFE -> ----------------------------------
-    ::osl::ResettableMutexGuard aLock(m_aLock);
+    std::unique_lock aLock(m_aLock);
 
     // take over the uno service manager
     m_xContext = rxContext;
@@ -115,19 +115,19 @@ void AcceleratorExecute::init(const css::uno::Reference< 
css::uno::XComponentCon
     m_xDispatcher.set(xEnv, css::uno::UNO_QUERY);
     if (!m_xDispatcher.is())
     {
-        aLock.clear();
+        aLock.unlock();
         // <- SAFE ------------------------------
 
         css::uno::Reference< css::frame::XDispatchProvider > 
xDispatcher(css::frame::Desktop::create(rxContext), css::uno::UNO_QUERY_THROW);
 
         // SAFE -> ------------------------------
-        aLock.reset();
+        aLock.lock();
 
         m_xDispatcher  = xDispatcher;
         bDesktopIsUsed = true;
     }
 
-    aLock.clear();
+    aLock.unlock();
     // <- SAFE ----------------------------------
 
     // open all needed configuration objects
@@ -153,13 +153,13 @@ void AcceleratorExecute::init(const css::uno::Reference< 
css::uno::XComponentCon
     }
 
     // SAFE -> ------------------------------
-    aLock.reset();
+    aLock.lock();
 
     m_xGlobalCfg = xGlobalCfg;
     m_xModuleCfg = xModuleCfg;
     m_xDocCfg    = xDocCfg   ;
 
-    aLock.clear();
+    aLock.unlock();
     // <- SAFE ----------------------------------
 }
 
@@ -183,11 +183,11 @@ bool AcceleratorExecute::execute(const 
css::awt::KeyEvent& aAWTKey)
     }
 
     // SAFE -> ----------------------------------
-    osl::ClearableMutexGuard aLock(m_aLock);
+    std::unique_lock aLock(m_aLock);
 
     css::uno::Reference< css::frame::XDispatchProvider > xProvider = 
m_xDispatcher;
 
-    aLock.clear();
+    aLock.unlock();
     // <- SAFE ----------------------------------
 
     // convert command in URL structure
@@ -261,13 +261,13 @@ OUString AcceleratorExecute::findCommand(const 
css::awt::KeyEvent& aKey)
 OUString AcceleratorExecute::impl_ts_findCommand(const css::awt::KeyEvent& 
aKey)
 {
     // SAFE -> ----------------------------------
-    osl::ClearableMutexGuard aLock(m_aLock);
+    std::unique_lock aLock(m_aLock);
 
     css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg = 
m_xGlobalCfg;
     css::uno::Reference< css::ui::XAcceleratorConfiguration > xModuleCfg = 
m_xModuleCfg;
     css::uno::Reference< css::ui::XAcceleratorConfiguration > xDocCfg    = 
m_xDocCfg   ;
 
-    aLock.clear();
+    aLock.unlock();
     // <- SAFE ----------------------------------
 
     OUString sCommand;
@@ -423,21 +423,21 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > 
AcceleratorExecute::st
 css::uno::Reference< css::util::XURLTransformer > 
AcceleratorExecute::impl_ts_getURLParser()
 {
     // SAFE -> ----------------------------------
-    ::osl::ResettableMutexGuard aLock(m_aLock);
+    std::unique_lock aLock(m_aLock);
 
     if (m_xURLParser.is())
         return m_xURLParser;
     css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
 
-    aLock.clear();
+    aLock.unlock();
     // <- SAFE ----------------------------------
 
     css::uno::Reference< css::util::XURLTransformer > xParser =  
css::util::URLTransformer::create( xContext );
 
     // SAFE -> ----------------------------------
-    aLock.reset();
+    aLock.lock();
     m_xURLParser = xParser;
-    aLock.clear();
+    aLock.unlock();
     // <- SAFE ----------------------------------
 
     return xParser;

Reply via email to