[Libreoffice-commits] core.git: sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 17 08:04:14 UTC 2018


 sd/source/ui/view/ToolBarManager.cxx |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

New commits:
commit 1ac3738abadb03ce0508d4e69741b4a1d32f8617
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Oct 16 21:10:22 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Oct 17 10:03:22 2018 +0200

    Resolves: tdf#119997 toolbar layout unlock doesn't refresh ui
    
    because lock was taken when toolbar layout wasn't set yet
    
    Change-Id: I695493d4fb637210c72b9ce53af9f089c79b0c7b
    Reviewed-on: https://gerrit.libreoffice.org/61848
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index cb802fd3ef9d..178efab47d41 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -60,12 +60,10 @@ class ToolBarRules;
 
 /** Lock of the frame::XLayoutManager.
 */
-class LayouterLock
+struct LayouterLock
 {
-public:
     explicit LayouterLock (const Reference<frame::XLayoutManager>& rxLayouter);
     ~LayouterLock();
-private:
     Reference<frame::XLayoutManager> mxLayouter;
 };
 
@@ -577,6 +575,10 @@ void ToolBarManager::Implementation::SetValid (bool bValid)
                 Reference<beans::XPropertySet> xFrameProperties (xFrame, UNO_QUERY_THROW);
                 Any aValue (xFrameProperties->getPropertyValue("LayoutManager"));
                 aValue >>= mxLayouter;
+                // tdf#119997 if mpSynchronousLayouterLock was created before mxLayouter was
+                // set then update it now that its available
+                if (mpSynchronousLayouterLock && !mpSynchronousLayouterLock->mxLayouter)
+                    mpSynchronousLayouterLock->mxLayouter = mxLayouter;
             }
             catch (const RuntimeException&)
             {
@@ -817,11 +819,14 @@ void ToolBarManager::Implementation::Update (
             // Note that the lock count may have been increased since
             // entering this method.  In that case one of the next
             // UnlockUpdate() calls will post the UpdateCallback.
-            if (mnPendingUpdateCall==nullptr && mnLockCount==0)
+            if (mnLockCount==0)
             {
                 mpAsynchronousLayouterLock = std::move(pLocalLayouterLock);
-                mnPendingUpdateCall = Application::PostUserEvent(
-                    LINK(this,ToolBarManager::Implementation,UpdateCallback));
+                if (mnPendingUpdateCall==nullptr)
+                {
+                    mnPendingUpdateCall = Application::PostUserEvent(
+                        LINK(this,ToolBarManager::Implementation,UpdateCallback));
+                }
             }
         }
         else


More information about the Libreoffice-commits mailing list