diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-11-09 17:33:22 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-11-09 20:42:28 +0100 |
commit | ea3fc61f29f6d53c4c65cf6026267f7a37ef1a87 (patch) | |
tree | cdb4cc096fa4c5c429268ac848d23b3b2a6910b9 /sd | |
parent | a32dea330e5767a68754b19f6005a78618765c1a (diff) |
Fix sd toolbar manager lock underflows
Regressions from commit 45519023aa44 ("Resolves: tdf#119997
toolbar layout unlock doesn't refresh ui"), commit c5977a89c28b
("Resolves: tdf#96451 do magic to enable embedded chart sidebar
only for chart") and commit faed29cac93f ("for now show chart
sidebar").
It also adds an assert for the underflow, as nobody cared for
the underflow warnings since some years.
Change-Id: I86bb093987f084c85a7b640a846dfe0aefea9e48
Reviewed-on: https://gerrit.libreoffice.org/63204
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/ToolBarManager.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index 178efab47d41..20f8a7979534 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -60,11 +60,13 @@ class ToolBarRules; /** Lock of the frame::XLayoutManager. */ -struct LayouterLock +class LayouterLock { + Reference<frame::XLayoutManager> mxLayouter; +public: explicit LayouterLock (const Reference<frame::XLayoutManager>& rxLayouter); ~LayouterLock(); - Reference<frame::XLayoutManager> mxLayouter; + bool is() const { return mxLayouter.is(); } }; /** Store a list of tool bars for each of the tool bar groups. From @@ -577,8 +579,8 @@ void ToolBarManager::Implementation::SetValid (bool bValid) 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; + if (mpSynchronousLayouterLock && !mpSynchronousLayouterLock->is()) + mpSynchronousLayouterLock.reset(new LayouterLock(mxLayouter)); } catch (const RuntimeException&) { |