summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Driesner <cd@openoffice.org>2010-11-11 11:46:35 +0100
committerCarsten Driesner <cd@openoffice.org>2010-11-11 11:46:35 +0100
commitadc43add6881cd34e7e676b898b3992b6e17e24d (patch)
tree5d31bf89b1073c82eaefed1eaf3201dada718915
parent744768bfaca0a15aea009d5620c95ce14e945abc (diff)
dockingwindows: #i115527# Fixed broken Reset function in View-Toolbars. Refresh method must read persistent state data.
-rwxr-xr-xframework/source/layoutmanager/layoutmanager.cxx9
-rwxr-xr-xframework/source/layoutmanager/toolbarlayoutmanager.cxx29
-rwxr-xr-xframework/source/layoutmanager/toolbarlayoutmanager.hxx2
3 files changed, 24 insertions, 16 deletions
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 1cdd893559..2118d5095a 100755
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -3135,13 +3135,13 @@ void SAL_CALL LayoutManager::elementReplaced( const ui::ConfigurationEvent& Even
parseResourceURL( Event.ResourceURL, aElementType, aElementName );
if ( aElementType.equalsIgnoreAsciiCaseAscii( UIRESOURCETYPE_TOOLBAR ))
- {
- if ( xToolbarManager.is() )
+ {
+ if ( xToolbarManager.is() )
{
xToolbarManager->elementReplaced( Event );
bRefreshLayout = pToolbarManager->isLayoutDirty();
}
- }
+ }
else
{
Reference< XUIElement > xUIElement = implts_findElement( Event.ResourceURL );
@@ -3200,10 +3200,11 @@ void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 n
ReadGuard aReadLock( m_aLock );
Reference< ui::XUIConfigurationListener > xToolbarManager( m_xToolbarManager );
ToolbarLayoutManager* pToolbarManager = m_pToolbarManager;
+ bool bAutomaticToolbars( m_bAutomaticToolbars );
aReadLock.unlock();
if ( pToolbarManager )
- pToolbarManager->refreshToolbarsVisibility();
+ pToolbarManager->refreshToolbarsVisibility( bAutomaticToolbars );
}
break;
}
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 16568834ef..f2aa675f02 100755
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -595,28 +595,35 @@ bool ToolbarLayoutManager::hideToolbar( const ::rtl::OUString& rResourceURL )
return false;
}
-void ToolbarLayoutManager::refreshToolbarsVisibility()
+void ToolbarLayoutManager::refreshToolbarsVisibility( bool bAutomaticToolbars )
{
UIElementVector aUIElementVector;
+
+ ReadGuard aReadLock( m_aLock );
+ bool bVisible( m_bVisible );
+ aReadLock.unlock();
+
+ if ( !bVisible || !bAutomaticToolbars )
+ return;
+
implts_getUIElementVectorCopy( aUIElementVector );
+ UIElement aUIElement;
vos::OGuard aGuard( Application::GetSolarMutex() );
UIElementVector::iterator pIter;
for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); pIter++ )
{
- Window* pWindow = getWindowFromXUIElement( pIter->m_xUIElement );
- if ( pWindow )
+ if ( implts_readWindowStateData( pIter->m_aName, aUIElement ) &&
+ ( pIter->m_bVisible != aUIElement.m_bVisible ) && !pIter->m_bMasterHide )
{
- if ( pIter->m_bVisible && !pIter->m_bMasterHide )
+ WriteGuard aWriteLock( m_aLock );
+ UIElement& rUIElement = impl_findToolbar( pIter->m_aName );
+ if ( rUIElement.m_aName == pIter->m_aName )
{
- if ( pIter->m_bFloating )
- pWindow->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
- else
- implts_setLayoutDirty();
+ rUIElement.m_bVisible = aUIElement.m_bVisible;
+ implts_setLayoutDirty();
}
- else
- pWindow->Show( FALSE );
- }
+ }
}
}
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.hxx b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
index 5b3f62d8a7..b37d88ea87 100755
--- a/framework/source/layoutmanager/toolbarlayoutmanager.hxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
@@ -128,7 +128,7 @@ class ToolbarLayoutManager : public ::cppu::WeakImplHelper3< ::com::sun::star::a
bool showToolbar( const ::rtl::OUString& rResourceURL );
bool hideToolbar( const ::rtl::OUString& rResourceURL );
- void refreshToolbarsVisibility();
+ void refreshToolbarsVisibility( bool bAutomaticToolbars );
void setFloatingToolbarsVisibility( bool bVisible );
void setVisible(bool bVisible);
bool isVisible() { return m_bVisible; }