diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-16 21:10:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-17 10:03:22 +0200 |
commit | 1ac3738abadb03ce0508d4e69741b4a1d32f8617 (patch) | |
tree | e31332695a28b4555d153da36c21e2a5b97c2ba4 | |
parent | 87bd462eff0e746835bb4e449bdea19ff3749580 (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/61848
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sd/source/ui/view/ToolBarManager.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
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 |