openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1590666 - /openoffice/trunk/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx
Date Mon, 28 Apr 2014 15:09:36 GMT
Author: orw
Date: Mon Apr 28 15:09:35 2014
New Revision: 1590666

URL: http://svn.apache.org/r1590666
Log:
124674: Toolbarmanager: correct show/hide of toolbars (correction of fix for issue 124355);
correct consideration of hidden toolbars;


Modified:
    openoffice/trunk/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx

Modified: openoffice/trunk/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx?rev=1590666&r1=1590665&r2=1590666&view=diff
==============================================================================
--- openoffice/trunk/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx (original)
+++ openoffice/trunk/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx Mon Apr
28 15:09:35 2014
@@ -332,6 +332,12 @@ Rectangle ToolbarLayoutManager::implts_c
         // Note: For each docking area row resp. column only the size of largest UIElement
is collected.
         for ( UIElementVector::const_iterator pConstIter = m_aUIElements.begin(); pConstIter
!= m_aUIElements.end(); ++pConstIter )
         {
+            if ( !pConstIter->m_bVisible
+                 || pConstIter->m_bMasterHide )
+            {
+                continue;
+            }
+
             uno::Reference< ui::XUIElement > xUIElement( pConstIter->m_xUIElement,
uno::UNO_QUERY );
             if ( xUIElement.is() )
             {
@@ -340,7 +346,8 @@ Rectangle ToolbarLayoutManager::implts_c
                 if ( xWindow.is() && xDockWindow.is() )
                 {
                     Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
-                    if ( pWindow && !xDockWindow->isFloating() && pConstIter->m_bVisible
)
+                    if ( pWindow != NULL
+                         && !xDockWindow->isFloating() )
                     {
                         const awt::Rectangle aPosSize = xWindow->getPosSize();
                         insertDockingAreaSize(
@@ -572,9 +579,6 @@ bool ToolbarLayoutManager::implts_setToo
         {
             implts_setLayoutDirty();
         }
-        aUIElement.m_bVisible = bVisible;
-        implts_writeWindowStateData( aUIElement );
-        implts_setToolbar( aUIElement );
 
         bRet = true;
     }
@@ -586,6 +590,9 @@ bool ToolbarLayoutManager::showToolbar( 
 {
     UIElement aUIElement = implts_findToolbar( rResourceURL );
     const bool bRet = implts_setToolbarVisibility( true, aUIElement );
+    aUIElement.m_bVisible = true;
+    implts_writeWindowStateData( aUIElement );
+    implts_setToolbar( aUIElement );
     implts_sortUIElements();
     return bRet;
 }
@@ -594,6 +601,9 @@ bool ToolbarLayoutManager::hideToolbar( 
 {
     UIElement aUIElement = implts_findToolbar( rResourceURL );
     const bool bRet = implts_setToolbarVisibility( false, aUIElement );
+    aUIElement.m_bVisible = false;
+    implts_writeWindowStateData( aUIElement );
+    implts_setToolbar( aUIElement );
     implts_sortUIElements();
     return bRet;
 }
@@ -643,13 +653,13 @@ void ToolbarLayoutManager::setFloatingTo
         if ( pWindow && pIter->m_bFloating )
         {
             if ( bVisible )
-            {    
+            {
                 if ( pIter->m_bVisible && !pIter->m_bMasterHide )
                     pWindow->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
             }
             else
                 pWindow->Show( sal_False );
-        }            
+        }
     }
 }
 
@@ -662,8 +672,9 @@ void ToolbarLayoutManager::setVisible( b
     UIElementVector::iterator pIter;
     for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); pIter++ )
     {
-        pIter->m_bMasterHide = !bVisible;
         implts_setToolbarVisibility( bVisible, *pIter );
+        pIter->m_bMasterHide = !bVisible;
+        implts_setToolbar( *pIter );
     }
 
     implts_sortUIElements();
@@ -758,16 +769,18 @@ bool ToolbarLayoutManager::dockAllToolba
 {
     std::vector< ::rtl::OUString > aToolBarNameVector;
 
-    ::rtl::OUString aElementType;
-    ::rtl::OUString aElementName;
-
     ReadGuard aReadLock( m_aLock );
     UIElementVector::iterator pIter;
     for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); pIter++ )
     {
-        if ( pIter->m_aType.equalsAscii( "toolbar" ) && pIter->m_xUIElement.is()
&&
-             pIter->m_bFloating && pIter->m_bVisible )
+        if ( pIter->m_aType.equalsAscii( "toolbar" )
+             && pIter->m_xUIElement.is()
+             && pIter->m_bFloating
+             && pIter->m_bVisible
+             && !pIter->m_bMasterHide )
+        {
             aToolBarNameVector.push_back( pIter->m_aName );
+        }
     }
     aReadLock.unlock();
 
@@ -1371,7 +1384,7 @@ uno::Reference< ui::XUIElement > Toolbar
 void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno::Reference<
awt::XDockableWindow >& rDockWindow )
 {
     ReadGuard aReadLock( m_aLock );
-    bool bShowElement( rElement.m_bVisible && !rElement.m_bMasterHide &&
implts_isParentWindowVisible() );
+    const bool bShowElement( rElement.m_bVisible && !rElement.m_bMasterHide &&
implts_isParentWindowVisible() );
     aReadLock.unlock();
 
     uno::Reference< awt::XDockableWindow > xDockWindow( rDockWindow );
@@ -2012,7 +2025,10 @@ void ToolbarLayoutManager::implts_getDoc
     UIElementVector::iterator   pIter;
     for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); pIter++ )
     {
-        if ( pIter->m_aDockedData.m_nDockedArea == eDockingArea && pIter->m_bVisible
&& !pIter->m_bFloating )
+        if ( pIter->m_aDockedData.m_nDockedArea == eDockingArea
+             && pIter->m_bVisible
+             && !pIter->m_bMasterHide
+             && !pIter->m_bFloating )
         {
             uno::Reference< ui::XUIElement > xUIElement( pIter->m_xUIElement );
             if ( xUIElement.is() )
@@ -2196,7 +2212,10 @@ void ToolbarLayoutManager::implts_getDoc
     UIElementVector::iterator   pEnd = m_aUIElements.end();
     for ( pIter = m_aUIElements.begin(); pIter != pEnd; pIter++ )
     {
-        if ( pIter->m_aDockedData.m_nDockedArea == eDockingArea )
+        if ( pIter->m_aDockedData.m_nDockedArea == eDockingArea
+             && pIter->m_bVisible
+             && !pIter->m_bMasterHide
+             && !pIter->m_bFloating )
         {
             bool bSameRowCol = bHorzDockArea ? ( pIter->m_aDockedData.m_aPos.Y() == nRowCol
) : ( pIter->m_aDockedData.m_aPos.X() == nRowCol );
             uno::Reference< ui::XUIElement > xUIElement( pIter->m_xUIElement );
@@ -2209,8 +2228,11 @@ void ToolbarLayoutManager::implts_getDoc
                     vos::OGuard aGuard( Application::GetSolarMutex() );
                     Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
                     uno::Reference< awt::XDockableWindow > xDockWindow( xWindow, uno::UNO_QUERY
);
-                    if ( pWindow && pIter->m_bVisible && xDockWindow.is()
&& !pIter->m_bFloating )
+                    if ( pWindow != NULL
+                         && xDockWindow.is() )
+                    {
                         aWindowVector.push_back( *pIter ); // docked windows
+                    }
                 }
             }
         }



Mime
View raw message