summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-16 21:10:22 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-18 16:20:13 +0200
commit45519023aa44940a68f40643fdff6551a2b7adb3 (patch)
treee3d58b35c95ce6018e85134f00c43c5b8dd898ae /sd
parentfaf048080124a4e1c9fcb4637fa9541921c758bd (diff)
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í <xiscofauli@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/ToolBarManager.cxx17
1 files changed, 11 insertions, 6 deletions
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