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

Michael Stahl mstahl at redhat.com
Thu Dec 15 12:40:46 UTC 2016


 framework/source/layoutmanager/toolbarlayoutmanager.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit d266cb32c3c982a60cd68650dd7ae8983744134e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Dec 15 13:04:00 2016 +0100

    tdf#104621 framework: Redo commit 84f2ff67a7e404febf710b1dc7f66d06745c503f
    
    The fix was silly and wrong, need to check m_xUIElement, not m_aName,
    which may be set independently, see the confusing code in
    ToolbarLayoutManager::requestToolbar().
    
    Change-Id: I279088cb2516b0a19619b5647f15f738a2624edf

diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index f870b40..38a36046 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -506,7 +506,7 @@ bool ToolbarLayoutManager::createToolbar( const OUString& rResourceURL )
             SolarMutexClearableGuard aWriteLock;
 
             UIElement& rElement = impl_findToolbar( rResourceURL );
-            if ( !rElement.m_aName.isEmpty() )
+            if (rElement.m_xUIElement.is())
             {
                 // somebody else must have created it while we released
                 // the SolarMutex - just dispose our new instance and
@@ -517,6 +517,15 @@ bool ToolbarLayoutManager::createToolbar( const OUString& rResourceURL )
                 xC->dispose();
                 return false;
             }
+            if ( !rElement.m_aName.isEmpty() )
+            {
+                // Reuse a local entry so we are able to use the latest
+                // UI changes for this document.
+                implts_setElementData( rElement, xDockWindow );
+                rElement.m_xUIElement = xUIElement;
+                bVisible = rElement.m_bVisible;
+                bFloating = rElement.m_bFloating;
+            }
             else
             {
                 // Create new UI element and try to read its state data


More information about the Libreoffice-commits mailing list