include/svtools/popupmenucontrollerbase.hxx    |    2 ++
 svtools/source/uno/popupmenucontrollerbase.cxx |   11 +++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 5c4d4b370d2f6645c797c626d407013702f474c7
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Mar 3 09:01:40 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Mar 3 08:09:17 2023 +0000

    tdf#153926 crash when trying to change language for selection
    
    regression from
        commit 5032262fccd0ef7f274323ae481b3230ffd42d3a
        Author: Noel Grandin <noel.gran...@collabora.co.uk>
        Date:   Tue Feb 21 15:05:37 2023 +0200
        BaseMutex->std::mutex in PopupMenuControllerBase
    
    Change-Id: I46b6458a809659845de26059fcab4772e5089ce6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148161
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svtools/popupmenucontrollerbase.hxx 
b/include/svtools/popupmenucontrollerbase.hxx
index c0a8b531acf6..b484aafd7a06 100644
--- a/include/svtools/popupmenucontrollerbase.hxx
+++ b/include/svtools/popupmenucontrollerbase.hxx
@@ -95,6 +95,8 @@ namespace svt
     protected:
             virtual void initializeImpl( std::unique_lock<std::mutex>& rGuard, 
const css::uno::Sequence< css::uno::Any >& aArguments );
 
+            void dispatchCommandImpl( std::unique_lock<std::mutex>& rGuard, 
const OUString& sCommandURL, const css::uno::Sequence< 
css::beans::PropertyValue >& rArgs, const OUString& sTarget );
+
             /** helper method to cause statusChanged is called once for the 
given command url */
             void updateCommand( const OUString& rCommandURL );
 
diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx 
b/svtools/source/uno/popupmenucontrollerbase.cxx
index e74bbc32b655..61df2a4645af 100644
--- a/svtools/source/uno/popupmenucontrollerbase.cxx
+++ b/svtools/source/uno/popupmenucontrollerbase.cxx
@@ -111,7 +111,7 @@ void SAL_CALL PopupMenuControllerBase::itemSelected( const 
awt::MenuEvent& rEven
     if( m_xPopupMenu.is() )
     {
         Sequence<PropertyValue> aArgs;
-        dispatchCommand( m_xPopupMenu->getCommand( rEvent.MenuId ), aArgs );
+        dispatchCommandImpl( aLock, m_xPopupMenu->getCommand( rEvent.MenuId ), 
aArgs, OUString() );
     }
 }
 
@@ -120,8 +120,15 @@ void PopupMenuControllerBase::dispatchCommand( const 
OUString& sCommandURL,
                                                const OUString& sTarget )
 {
     std::unique_lock aLock( m_aMutex );
-
     throwIfDisposed(aLock);
+    dispatchCommandImpl(aLock, sCommandURL, rArgs, sTarget);
+}
+
+void PopupMenuControllerBase::dispatchCommandImpl( 
std::unique_lock<std::mutex>& /*rGuard*/,
+                                               const OUString& sCommandURL,
+                                               const css::uno::Sequence< 
css::beans::PropertyValue >& rArgs,
+                                               const OUString& sTarget )
+{
 
     try
     {

Reply via email to