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

New commits:
commit 45519023aa44940a68f40643fdff6551a2b7adb3
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Oct 16 21:10:22 2018 +0100
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Oct 18 16:20:13 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/61849
    Tested-by: Jenkins
    Tested-by: Xisco Faulí <xiscofa...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/source/ui/view/ToolBarManager.cxx 
b/sd/source/ui/view/ToolBarManager.cxx
index 91db27743b2a..dab18fdf8316 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -59,12 +59,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;
 };
 
@@ -579,6 +577,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&)
             {
@@ -821,11 +823,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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to