summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Driesner <cd@openoffice.org>2010-11-01 13:29:26 +0100
committerCarsten Driesner <cd@openoffice.org>2010-11-01 13:29:26 +0100
commit9849b4fc14d50a2f3c3bc033accf66f38de44a20 (patch)
treec1e0597e5e91177ae490c40c198a339846f2e54e
parent4c33b73c13355915471db23befe98d0080ee39eb (diff)
dockingwindows: #i112595# Fixed problem related to changes for better layouting. Further code rework
-rwxr-xr-xframework/source/layoutmanager/helpers.cxx8
-rwxr-xr-xframework/source/layoutmanager/helpers.hxx4
-rwxr-xr-xframework/source/layoutmanager/layoutmanager.cxx427
-rwxr-xr-xframework/source/layoutmanager/toolbarlayoutmanager.cxx202
-rwxr-xr-xframework/source/layoutmanager/toolbarlayoutmanager.hxx1
5 files changed, 280 insertions, 362 deletions
diff --git a/framework/source/layoutmanager/helpers.cxx b/framework/source/layoutmanager/helpers.cxx
index a397734512..d1f9c50fd8 100755
--- a/framework/source/layoutmanager/helpers.cxx
+++ b/framework/source/layoutmanager/helpers.cxx
@@ -77,9 +77,9 @@ bool isDefaultPos( const ::Point& aPos )
return (( aPos.X() == SAL_MAX_INT32 ) && ( aPos.Y() == SAL_MAX_INT32 ));
}
-bool isReverseOrderDockingArea( const sal_Int16 nDockArea )
+bool isReverseOrderDockingArea( const sal_Int32 nDockArea )
{
- ui::DockingArea eDockArea = (ui::DockingArea)nDockArea;
+ ui::DockingArea eDockArea = static_cast< ui::DockingArea >( nDockArea );
return (( eDockArea == ui::DockingArea_DOCKINGAREA_BOTTOM ) ||
( eDockArea == ui::DockingArea_DOCKINGAREA_RIGHT ));
}
@@ -97,9 +97,9 @@ bool isHorizontalDockingArea( const ui::DockingArea& nDockingArea )
( nDockingArea == ui::DockingArea_DOCKINGAREA_BOTTOM ));
}
-bool isHorizontalDockingArea( const sal_Int16 nDockArea )
+bool isHorizontalDockingArea( const sal_Int32 nDockArea )
{
- return isHorizontalDockingArea((ui::DockingArea)nDockArea );
+ return isHorizontalDockingArea(static_cast< ui::DockingArea >( nDockArea ));
}
::rtl::OUString retrieveToolbarNameFromHelpURL( Window* pWindow )
diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx
index b5d08c3ea1..545abb2a1f 100755
--- a/framework/source/layoutmanager/helpers.hxx
+++ b/framework/source/layoutmanager/helpers.hxx
@@ -65,8 +65,8 @@ bool hasDefaultPosValue( const ::Point& aPos );
bool isDefaultPos( const ::com::sun::star::awt::Point& aPos );
bool isDefaultPos( const ::Point& aPos );
bool isToolboxHorizontalAligned( ToolBox* pToolBox );
-bool isReverseOrderDockingArea( const sal_Int16 nDockArea );
-bool isHorizontalDockingArea( const sal_Int16 nDockArea );
+bool isReverseOrderDockingArea( const sal_Int32 nDockArea );
+bool isHorizontalDockingArea( const sal_Int32 nDockArea );
bool isHorizontalDockingArea( const ::com::sun::star::ui::DockingArea& nDockArea );
::rtl::OUString retrieveToolbarNameFromHelpURL( Window* pWindow );
ToolBox* getToolboxPtr( Window* pWindow );
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 1c66f894a2..8c266f5010 100755
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
-// my own includes
+// my own includes
#include <services/layoutmanager.hxx>
#include <helpers.hxx>
#include <panelmanager.hxx>
@@ -47,7 +47,7 @@
#include <uiconfiguration/globalsettings.hxx>
#include <toolbarlayoutmanager.hxx>
-// interface includes
+// interface includes
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -71,7 +71,7 @@
#include <com/sun/star/frame/XDispatchHelper.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
-// other includes
+// other includes
#include <svtools/imgdef.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/window.hxx>
@@ -91,7 +91,7 @@
#include <algorithm>
#include <boost/bind.hpp>
-// using namespace
+// using namespace
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -123,21 +123,21 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
, m_xURLTransformer( xServiceManager->createInstance( SERVICENAME_URLTRANSFORMER ), UNO_QUERY )
, m_xDisplayAccess( xServiceManager->createInstance( SERVICENAME_DISPLAYACCESS ), UNO_QUERY )
, m_nLockCount( 0 )
- , m_bActive( sal_False )
- , m_bInplaceMenuSet( sal_False )
- , m_bDockingInProgress( sal_False )
- , m_bMenuVisible( sal_True )
- , m_bComponentAttached( sal_False )
- , m_bDoLayout( sal_False )
- , m_bVisible( sal_True )
- , m_bParentWindowVisible( sal_False )
- , m_bMustDoLayout( sal_True )
- , m_bAutomaticToolbars( sal_True )
- , m_bStoreWindowState( sal_False )
+ , m_bActive( false )
+ , m_bInplaceMenuSet( false )
+ , m_bDockingInProgress( false )
+ , m_bMenuVisible( true )
+ , m_bComponentAttached( false )
+ , m_bDoLayout( false )
+ , m_bVisible( true )
+ , m_bParentWindowVisible( false )
+ , m_bMustDoLayout( true )
+ , m_bAutomaticToolbars( true )
+ , m_bStoreWindowState( false )
, m_bHideCurrentUI( false )
- , m_bGlobalSettings( sal_False )
+ , m_bGlobalSettings( false )
, m_bPreserveContentSize( false )
- , m_bMenuBarCloser( sal_False )
+ , m_bMenuBarCloser( false )
, m_pInplaceMenuBar( NULL )
, m_xModuleManager( Reference< XModuleManager >( xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY ))
, m_xUIElementFactoryManager( Reference< ui::XUIElementFactory >(
@@ -200,9 +200,9 @@ void LayoutManager::impl_clearUpMenuBar()
SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow );
if ( pSysWindow )
- {
+ {
MenuBar* pSetMenuBar = 0;
- if ( m_xInplaceMenuBar.is() )
+ if ( m_xInplaceMenuBar.is() )
pSetMenuBar = (MenuBar *)m_pInplaceMenuBar->GetMenuBar();
else
{
@@ -215,12 +215,8 @@ void LayoutManager::impl_clearUpMenuBar()
{
xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMenuBar" ))) >>= xMenuBar;
}
- catch ( beans::UnknownPropertyException )
- {
- }
- catch ( lang::WrappedTargetException )
- {
- }
+ catch ( beans::UnknownPropertyException ) {}
+ catch ( lang::WrappedTargetException ) {}
}
VCLXMenu* pAwtMenuBar = VCLXMenu::GetImplementation( xMenuBar );
@@ -228,9 +224,9 @@ void LayoutManager::impl_clearUpMenuBar()
pSetMenuBar = (MenuBar*)pAwtMenuBar->GetMenu();
}
- MenuBar* pTopMenuBar = pSysWindow->GetMenuBar();
- if ( pSetMenuBar == pTopMenuBar )
- pSysWindow->SetMenuBar( 0 );
+ MenuBar* pTopMenuBar = pSysWindow->GetMenuBar();
+ if ( pSetMenuBar == pTopMenuBar )
+ pSysWindow->SetMenuBar( 0 );
}
}
@@ -292,9 +288,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
{
aModuleIdentifier = m_xModuleManager->identify( Reference< XInterface >( xFrame, UNO_QUERY ) );
}
- catch( Exception& )
- {
- }
+ catch( Exception& ) {}
if ( aModuleIdentifier.getLength() && aOldModuleIdentifier != aModuleIdentifier )
{
@@ -310,9 +304,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
// Remove listener to old module ui configuration manager
xModuleCfgMgr->removeConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
- catch ( Exception& )
- {
- }
+ catch ( Exception& ) {}
}
try
@@ -322,9 +314,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
if ( xModuleCfgMgr.is() )
xModuleCfgMgr->addConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
- catch ( Exception& )
- {
- }
+ catch ( Exception& ) {}
try
{
@@ -332,12 +322,8 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
if ( xPersistentWindowStateSupplier.is() )
xPersistentWindowStateSupplier->getByName( aModuleIdentifier ) >>= xPersistentWindowState;
}
- catch ( NoSuchElementException& )
- {
- }
- catch ( WrappedTargetException& )
- {
- }
+ catch ( NoSuchElementException& ) {}
+ catch ( WrappedTargetException& ) {}
}
xModel = impl_getModelFromFrame( xFrame );
@@ -353,9 +339,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
// Remove listener to old ui configuration manager
xDocCfgMgr->removeConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
- catch ( Exception& )
- {
- }
+ catch ( Exception& ) {}
}
try
@@ -364,9 +348,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
if ( xDocCfgMgr.is() )
xDocCfgMgr->addConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
- catch ( Exception& )
- {
- }
+ catch ( Exception& ) {}
}
}
}
@@ -380,9 +362,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
xModuleCfgMgr->removeConfigurationListener(
Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
- catch ( Exception& )
- {
- }
+ catch ( Exception& ) {}
}
if ( xDocCfgMgr.is() )
@@ -392,9 +372,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
xDocCfgMgr->removeConfigurationListener(
Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
- catch ( Exception& )
- {
- }
+ catch ( Exception& ) {}
}
// Release references to our configuration managers as we currently don't have
@@ -421,22 +399,22 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
aWriteLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- // reset/notify toolbar layout manager
- if ( pToolbarManager )
- {
- if ( bAttached )
- {
- pToolbarManager->attach( xFrame, xModCfgMgr, xDokCfgMgr, xPersistentWindowState );
- uno::Reference< awt::XWindowPeer > xParent( xContainerWindow, UNO_QUERY );
- pToolbarManager->setParentWindow( xParent );
- if ( bAutomaticToolbars )
- pToolbarManager->createStaticToolbars();
- }
- else
+ // reset/notify toolbar layout manager
+ if ( pToolbarManager )
{
- pToolbarManager->reset();
- implts_destroyElements();
- }
+ if ( bAttached )
+ {
+ pToolbarManager->attach( xFrame, xModCfgMgr, xDokCfgMgr, xPersistentWindowState );
+ uno::Reference< awt::XWindowPeer > xParent( xContainerWindow, UNO_QUERY );
+ pToolbarManager->setParentWindow( xParent );
+ if ( bAutomaticToolbars )
+ pToolbarManager->createStaticToolbars();
+ }
+ else
+ {
+ pToolbarManager->reset();
+ implts_destroyElements();
+ }
}
}
@@ -517,46 +495,6 @@ UIElement& LayoutManager::impl_findElement( const rtl::OUString& aName )
return aEmptyElement;
}
-void LayoutManager::implts_writeNewStateData( const rtl::OUString aName, const Reference< awt::XWindow >& xWindow )
-{
- awt::Rectangle aPos;
- awt::Size aSize;
- sal_Bool bVisible( sal_False );
- sal_Bool bFloating( sal_True );
-
- if ( xWindow.is() )
- {
- Reference< awt::XDockableWindow > xDockWindow( xWindow, UNO_QUERY );
- if ( xDockWindow.is() )
- bFloating = xDockWindow->isFloating();
-
- Reference< awt::XWindow2 > xWindow2( xWindow, UNO_QUERY );
- if( xWindow2.is() )
- {
- aPos = xWindow2->getPosSize();
- aSize = xWindow2->getOutputSize(); // always use output size for consistency
- bVisible = xWindow2->isVisible();
- }
- }
-
- WriteGuard aWriteLock( m_aLock );
- UIElement& rUIElement = impl_findElement( aName );
- if ( rUIElement.m_xUIElement.is() && xWindow.is() )
- {
- rUIElement.m_bVisible = bVisible;
- rUIElement.m_bFloating = bFloating;
- if ( bFloating )
- {
- rUIElement.m_aFloatingData.m_aPos = ::Point( aPos.X, aPos.Y );
- rUIElement.m_aFloatingData.m_aSize = ::Size( aSize.Width, aSize.Height );
- }
- }
-
- implts_writeWindowStateData( aName, rUIElement );
-
- aWriteLock.unlock();
-}
-
sal_Bool LayoutManager::implts_readWindowStateData( const rtl::OUString& aName, UIElement& rElementData )
{
sal_Bool bGetSettingsState( sal_False );
@@ -692,9 +630,7 @@ sal_Bool LayoutManager::implts_readWindowStateData( const rtl::OUString& aName,
return sal_True;
}
- catch ( NoSuchElementException& )
- {
- }
+ catch ( NoSuchElementException& ) {}
}
return sal_False;
@@ -723,9 +659,7 @@ void LayoutManager::implts_writeWindowStateData( const rtl::OUString& aName, con
// Non-configurable elements should at least store their dimension/position
bPersistent = sal_True;
}
- catch ( lang::WrappedTargetException )
- {
- }
+ catch ( lang::WrappedTargetException ) {}
}
if ( bPersistent && xPersistentWindowState.is() )
@@ -774,9 +708,7 @@ void LayoutManager::implts_writeWindowStateData( const rtl::OUString& aName, con
xInsert->insertByName( aName, makeAny( aWindowState ));
}
}
- catch ( Exception& )
- {
- }
+ catch ( Exception& ) {}
}
// Reset flag
@@ -791,7 +723,7 @@ void LayoutManager::implts_writeWindowStateData( const rtl::OUString& aName, con
Window* pContainerWindow( 0 );
// Retrieve output size from container Window
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
pContainerWindow = VCLUnoHelper::GetWindow( m_xContainerWindow );
if ( pContainerWindow )
aContainerWinSize = pContainerWindow->GetOutputSizePixel();
@@ -814,12 +746,8 @@ Reference< XUIElement > LayoutManager::implts_createElement( const rtl::OUString
{
xUIElement = m_xUIElementFactoryManager->createUIElement( aName, aPropSeq );
}
- catch ( NoSuchElementException& )
- {
- }
- catch ( IllegalArgumentException& )
- {
- }
+ catch ( NoSuchElementException& ) {}
+ catch ( IllegalArgumentException& ) {}
return xUIElement;
}
@@ -844,17 +772,16 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible )
std::vector< Reference< awt::XWindow > > aWinVector;
WriteGuard aWriteLock( m_aLock );
- bool bOld( m_bDoLayout );
Reference< XUIElement > xMenuBar( m_xMenuBar, UNO_QUERY );
Reference< awt::XWindow > xContainerWindow( m_xContainerWindow );
Reference< XComponent > xInplaceMenuBar( m_xInplaceMenuBar );
- MenuBarManager* pInplaceMenuBar( m_pInplaceMenuBar );
- m_bDoLayout = sal_True;
+ MenuBarManager* pInplaceMenuBar( m_pInplaceMenuBar );
aWriteLock.unlock();
+ bool bMustDoLayout(false);
if (( xMenuBar.is() || xInplaceMenuBar.is() ) && xContainerWindow.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
MenuBar* pMenuBar( 0 );
if ( xInplaceMenuBar.is() )
@@ -872,36 +799,29 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible )
pSysWindow->SetMenuBar( pMenuBar );
else
pSysWindow->SetMenuBar( 0 );
+ bMustDoLayout = true;
}
}
// Hide/show the statusbar according to bSetVisible
if ( bSetVisible )
- implts_showStatusBar();
+ bMustDoLayout = !implts_showStatusBar();
else
- implts_hideStatusBar();
+ bMustDoLayout = !implts_hideStatusBar();
- if ( !bOld )
- {
- aWriteLock.lock();
- m_bDoLayout = sal_False;
- aWriteLock.unlock();
- }
+ aWriteLock.lock();
+ uno::Reference< ui::XUIConfigurationListener > xThis( m_xToolbarManager );
+ ToolbarLayoutManager* pToolbarManager( m_pToolbarManager );
+ aWriteLock.unlock();
- if ( bSetVisible )
+ if ( pToolbarManager )
{
- uno::Reference< ui::XUIConfigurationListener > xThis( m_xToolbarManager );
- if ( xThis.is() )
- m_pToolbarManager->setVisible(bSetVisible);
- implts_doLayout_notify( sal_False );
- }
- else
- {
- aWriteLock.lock();
- m_aDockingArea = awt::Rectangle();
- m_bMustDoLayout = sal_True;
- aWriteLock.unlock();
+ pToolbarManager->setVisible( bSetVisible );
+ bMustDoLayout = pToolbarManager->isLayoutDirty();
}
+
+ if ( bMustDoLayout )
+ implts_doLayout_notify( sal_False );
}
void LayoutManager::implts_setCurrentUIVisibility( sal_Bool bShow )
@@ -990,7 +910,7 @@ void LayoutManager::implts_createProgressBar()
{
Reference< awt::XWindow > xStatusBarWindow = pWrapper->getStatusBar();
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pStatusBarWnd = VCLUnoHelper::GetWindow( xStatusBarWindow );
if ( !pStatusBarWnd )
{
@@ -1080,7 +1000,7 @@ void LayoutManager::implts_setStatusBarPosSize( const ::Point& rPos, const ::Siz
if ( xWindow.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pParentWindow = VCLUnoHelper::GetWindow( xContainerWindow );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pParentWindow && ( pWindow && pWindow->GetType() == WINDOW_STATUSBAR ))
@@ -1122,7 +1042,7 @@ sal_Bool LayoutManager::implts_showProgressBar()
aWriteLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow )
{
@@ -1166,10 +1086,9 @@ sal_Bool LayoutManager::implts_hideProgressBar()
aWriteLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
- if ( pWindow && pWindow->IsVisible() &&
- ( bHideStatusBar || bInternalStatusBar ))
+ if ( pWindow && pWindow->IsVisible() && ( bHideStatusBar || bInternalStatusBar ))
{
implts_setOffset( 0 );
pWindow->Hide();
@@ -1192,7 +1111,7 @@ sal_Bool LayoutManager::implts_showStatusBar( sal_Bool bStoreState )
{
Reference< awt::XWindow > xWindow( xStatusBar->getRealInterface(), UNO_QUERY );
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow && !pWindow->IsVisible() )
{
@@ -1218,7 +1137,7 @@ sal_Bool LayoutManager::implts_hideStatusBar( sal_Bool bStoreState )
{
Reference< awt::XWindow > xWindow( xStatusBar->getRealInterface(), UNO_QUERY );
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow && pWindow->IsVisible() )
{
@@ -1272,9 +1191,9 @@ throw (uno::RuntimeException)
SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow );
if ( pSysWindow )
- pSysWindow->SetMenuBar( pMenuBar );
+ pSysWindow->SetMenuBar( pMenuBar );
- m_bInplaceMenuSet = sal_True;
+ m_bInplaceMenuSet = sal_True;
m_xInplaceMenuBar = Reference< XComponent >( (OWeakObject *)m_pInplaceMenuBar, UNO_QUERY );
}
@@ -1295,15 +1214,15 @@ throw (uno::RuntimeException)
// if ( m_xMenuBar.is() &&
if ( m_xContainerWindow.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
MenuBarWrapper* pMenuBarWrapper = SAL_STATIC_CAST( MenuBarWrapper*, m_xMenuBar.get() );
SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow );
if ( pSysWindow )
{
if ( pMenuBarWrapper )
- pSysWindow->SetMenuBar( (MenuBar *)pMenuBarWrapper->GetMenuBarManager()->GetMenuBar() );
- else
- pSysWindow->SetMenuBar( 0 );
+ pSysWindow->SetMenuBar( (MenuBar *)pMenuBarWrapper->GetMenuBarManager()->GetMenuBar() );
+ else
+ pSysWindow->SetMenuBar( 0 );
}
}
@@ -1402,7 +1321,7 @@ throw ( RuntimeException )
if ( !xDockingAreaAcceptor.is() )
m_aAsyncLayoutTimer.Stop();
- // Remove listener from old docking area acceptor
+ // Remove listener from old docking area acceptor
if ( m_xDockingAreaAcceptor.is() )
{
Reference< awt::XWindow > xWindow( m_xDockingAreaAcceptor->getContainerWindow() );
@@ -1411,7 +1330,7 @@ throw ( RuntimeException )
m_aDockingArea = awt::Rectangle();
if ( pToolbarManager )
- pToolbarManager->reset();
+ pToolbarManager->reset();
Window* pContainerWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pContainerWindow )
@@ -1457,7 +1376,7 @@ throw ( RuntimeException )
if ( xDockingAreaAcceptor.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
// Add layout manager as listener to get notifications about toolbar button activties
Window* pContainerWindow = VCLUnoHelper::GetWindow( m_xContainerWindow );
@@ -1503,18 +1422,13 @@ void LayoutManager::implts_reparentChildWindows()
{
xStatusBarWindow = Reference< awt::XWindow >( aStatusBarElement.m_xUIElement->getRealInterface(), UNO_QUERY );
}
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
+ catch ( RuntimeException& ) { throw; }
+ catch ( Exception& ) {}
}
if ( xStatusBarWindow.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
Window* pWindow = VCLUnoHelper::GetWindow( xStatusBarWindow );
if ( pWindow && pContainerWindow )
@@ -1534,13 +1448,20 @@ IMPL_LINK( LayoutManager, WindowEventListener, VclSimpleEvent*, pEvent )
{
long nResult( 1 );
- ReadGuard aReadLock( m_aLock );
- uno::Reference< ui::XUIConfigurationListener > xThis( m_xToolbarManager );
- ToolbarLayoutManager* pToolbarManager( m_pToolbarManager );
- aReadLock.unlock();
+ if ( pEvent && pEvent->ISA( VclWindowEvent ))
+ {
+ Window* pWindow = static_cast< VclWindowEvent* >(pEvent)->GetWindow();
+ if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX )
+ {
+ ReadGuard aReadLock( m_aLock );
+ uno::Reference< ui::XUIConfigurationListener > xThis( m_xToolbarManager );
+ ToolbarLayoutManager* pToolbarManager( m_pToolbarManager );
+ aReadLock.unlock();
- if ( pToolbarManager )
- nResult = pToolbarManager->childWindowEvent( pEvent );
+ if ( pToolbarManager )
+ nResult = pToolbarManager->childWindowEvent( pEvent );
+ }
+ }
return nResult;
}
@@ -1579,20 +1500,19 @@ throw (RuntimeException)
bNotify = m_pToolbarManager->createToolbar( aName );
bMustBeLayouted = m_pToolbarManager->isLayoutDirty();
}
- else if ( aElementType.equalsIgnoreAsciiCaseAscii( "menubar" ) &&
- aElementName.equalsIgnoreAsciiCaseAscii( "menubar" ))
+ else if ( aElementType.equalsIgnoreAsciiCaseAscii( "menubar" ) && aElementName.equalsIgnoreAsciiCaseAscii( "menubar" ))
{
// PB 2004-12-15 #i38743# don't create a menubar if frame isn't top
if ( !bInPlaceMenu && !m_xMenuBar.is() && implts_isFrameOrWindowTop( xFrame ))
- {
+ {
m_xMenuBar = implts_createElement( aName );
if ( m_xMenuBar.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow );
if ( pSysWindow )
- {
+ {
Reference< awt::XMenuBar > xMenuBar;
Reference< XPropertySet > xPropSet( m_xMenuBar, UNO_QUERY );
@@ -1602,27 +1522,23 @@ throw (RuntimeException)
{
xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMenuBar" ))) >>= xMenuBar;
}
- catch ( beans::UnknownPropertyException )
- {
- }
- catch ( lang::WrappedTargetException )
- {
- }
+ catch ( beans::UnknownPropertyException ) {}
+ catch ( lang::WrappedTargetException ) {}
}
if ( xMenuBar.is() )
{
- VCLXMenu* pAwtMenuBar = VCLXMenu::GetImplementation( xMenuBar );
- if ( pAwtMenuBar )
+ VCLXMenu* pAwtMenuBar = VCLXMenu::GetImplementation( xMenuBar );
+ if ( pAwtMenuBar )
{
MenuBar* pMenuBar = (MenuBar*)pAwtMenuBar->GetMenu();
if ( pMenuBar )
{
- pSysWindow->SetMenuBar( pMenuBar );
+ pSysWindow->SetMenuBar( pMenuBar );
pMenuBar->SetDisplayable( m_bMenuVisible );
- if ( m_bMenuVisible )
+ if ( m_bMenuVisible )
bNotify = sal_True;
- implts_updateMenuBarClose();
+ implts_updateMenuBarClose();
}
}
}
@@ -1636,9 +1552,7 @@ throw (RuntimeException)
implts_createStatusBar( aName );
bNotify = sal_True;
}
- else if ( aElementType.equalsIgnoreAsciiCaseAscii( "progressbar" ) &&
- aElementName.equalsIgnoreAsciiCaseAscii( "progressbar" ) &&
- implts_isFrameOrWindowTop(xFrame) )
+ else if ( aElementType.equalsIgnoreAsciiCaseAscii( "progressbar" ) && aElementName.equalsIgnoreAsciiCaseAscii( "progressbar" ) && implts_isFrameOrWindowTop(xFrame) )
{
implts_createProgressBar();
bNotify = sal_True;
@@ -1657,7 +1571,7 @@ throw (RuntimeException)
// The docking window is created by a factory method located in the sfx2 library.
// CreateDockingWindow( xFrame, aElementName );
- }
+ }
}
if ( bMustBeLayouted )
@@ -1765,8 +1679,8 @@ throw (uno::RuntimeException)
implts_readStatusBarState( rResourceURL );
if ( m_aStatusBarElement.m_bVisible && !m_aStatusBarElement.m_bMasterHide )
{
- aWriteLock.unlock();
- createElement( rResourceURL );
+ aWriteLock.unlock();
+ createElement( rResourceURL );
// There are some situation where we are not able to create an element.
// Therefore we have to check the reference before further action.
@@ -1775,7 +1689,7 @@ throw (uno::RuntimeException)
if ( xUIElement.is() )
{
// we need VCL here to pass special flags to Show()
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Reference< awt::XWindow > xWindow( xUIElement->getRealInterface(), UNO_QUERY );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow )
@@ -1796,8 +1710,7 @@ throw (uno::RuntimeException)
bNotify = true;
bDoLayout = true;
}
- else if ( aElementType.equalsIgnoreAsciiCaseAscii( UIRESOURCETYPE_TOOLBAR ) &&
- m_bParentWindowVisible && m_bVisible )
+ else if ( aElementType.equalsIgnoreAsciiCaseAscii( UIRESOURCETYPE_TOOLBAR ) && m_bVisible )
{
bool bComponentAttached( m_aModuleIdentifier.getLength() > 0 );
uno::Reference< uno::XInterface > xThis( m_xToolbarManager, uno::UNO_QUERY );
@@ -1806,9 +1719,9 @@ throw (uno::RuntimeException)
if ( pToolbarManager && bComponentAttached )
{
- bNotify = pToolbarManager->requestToolbar( rResourceURL );
+ bNotify = pToolbarManager->requestToolbar( rResourceURL );
bDoLayout = true;
- }
+ }
}
else if ( aElementType.equalsIgnoreAsciiCaseAscii( "dockingwindow" ))
{
@@ -1931,9 +1844,9 @@ throw (RuntimeException)
if ( pToolbarManager )
{
- bNotify = pToolbarManager->showToolbar( aName );
+ bNotify = pToolbarManager->showToolbar( aName );
bMustLayout = pToolbarManager->isLayoutDirty();
- }
+ }
}
else if ( aElementType.equalsIgnoreAsciiCaseAscii( "dockingwindow" ))
{
@@ -1984,7 +1897,7 @@ throw (RuntimeException)
{
m_bMenuVisible = sal_False;
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow );
if ( pSysWindow )
{
@@ -2079,7 +1992,7 @@ throw (RuntimeException)
{
bResult = pToolbarManager->dockAllToolbars();
if ( pToolbarManager->isLayoutDirty() )
- doLayout();
+ doLayout();
}
return bResult;
}
@@ -2096,10 +2009,10 @@ throw (RuntimeException)
aReadLock.unlock();
if ( pToolbarManager )
- {
+ {
bResult = pToolbarManager->floatToolbar( aName );
if ( pToolbarManager->isLayoutDirty() )
- doLayout();
+ doLayout();
}
}
return bResult;
@@ -2117,10 +2030,10 @@ throw (uno::RuntimeException)
aReadLock.unlock();
if ( pToolbarManager )
- {
+ {
bResult = pToolbarManager->lockToolbar( aName );
if ( pToolbarManager->isLayoutDirty() )
- doLayout();
+ doLayout();
}
}
return bResult;
@@ -2138,10 +2051,10 @@ throw (uno::RuntimeException)
aReadLock.unlock();
if ( pToolbarManager )
- {
+ {
bResult = pToolbarManager->unlockToolbar( aName );
if ( pToolbarManager->isLayoutDirty() )
- doLayout();
+ doLayout();
}
}
return bResult;
@@ -2158,10 +2071,10 @@ throw (RuntimeException)
aReadLock.unlock();
if ( pToolbarManager )
- {
+ {
pToolbarManager->setToolbarSize( aName, aSize );
if ( pToolbarManager->isLayoutDirty() )
- doLayout();
+ doLayout();
}
}
}
@@ -2177,10 +2090,10 @@ throw (RuntimeException)
aReadLock.unlock();
if ( pToolbarManager )
- {
+ {
pToolbarManager->setToolbarPos( aName, aPos );
if ( pToolbarManager->isLayoutDirty() )
- doLayout();
+ doLayout();
}
}
}
@@ -2196,11 +2109,11 @@ throw (RuntimeException)
aReadLock.unlock();
if ( pToolbarManager )
- {
+ {
pToolbarManager->setToolbarPosSize( aName, aPos, aSize );
if ( pToolbarManager->isLayoutDirty() )
- doLayout();
- }
+ doLayout();
+ }
}
}
@@ -2218,7 +2131,7 @@ throw (RuntimeException)
{
aReadLock.unlock();
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow );
if ( pSysWindow )
{
@@ -2402,15 +2315,15 @@ throw (RuntimeException)
// conform to documentation: unlock with lock count == 0 means force a layout
WriteGuard aWriteLock( m_aLock );
- if ( bDoLayout )
- m_aAsyncLayoutTimer.Stop();
- aWriteLock.unlock();
+ if ( bDoLayout )
+ m_aAsyncLayoutTimer.Stop();
+ aWriteLock.unlock();
Any a( nLockCount );
implts_notifyListeners( frame::LayoutManagerEvents::UNLOCK, a );
if ( bDoLayout )
- implts_doLayout_notify( sal_True );
+ implts_doLayout_notify( sal_True );
}
void SAL_CALL LayoutManager::doLayout()
@@ -2462,15 +2375,13 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_
{
bLayouted = sal_True;
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
WriteGuard aWriteGuard( m_aLock );
m_bDoLayout = sal_True;
aWriteGuard.unlock();
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
- awt::Rectangle aDockSpace( implts_calcDockingAreaSizes() );
- awt::Rectangle aBorderSpace( aDockSpace );
- sal_Bool bGotRequestedBorderSpace( sal_True );
+ awt::Rectangle aDockSpace( implts_calcDockingAreaSizes() );
+ awt::Rectangle aBorderSpace( aDockSpace );
+ sal_Bool bGotRequestedBorderSpace( sal_True );
// We have to add the height of a possible status bar
aBorderSpace.Height += implts_getStatusBarSize().Height();
@@ -2545,11 +2456,9 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_
xDockingAreaAcceptor->setDockingAreaSpace( aBorderSpace );
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
aWriteGuard.lock();
m_bDoLayout = sal_False;
aWriteGuard.unlock();
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
}
}
@@ -2559,14 +2468,12 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_
sal_Bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContainerSize,
const awt::Point& rComponentPos )
{
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
ReadGuard aReadLock( m_aLock );
Reference< awt::XWindow > xContainerWindow = m_xContainerWindow;
Reference< awt::XTopWindow2 > xContainerTopWindow = m_xContainerTopWindow;
Reference< awt::XWindow > xComponentWindow = m_xFrame->getComponentWindow();
Reference< container::XIndexAccess > xDisplayAccess = m_xDisplayAccess;
aReadLock.unlock();
- /* SAFE AREA ----------------------------------------------------------------------------------------------- */
// calculate the maximum size we have for the container window
awt::Rectangle aWorkArea;
@@ -2685,7 +2592,7 @@ void LayoutManager::implts_setDockingAreaWindowSizes( const awt::Rectangle& /*rB
}
//---------------------------------------------------------------------------------------------------------
-// XMenuCloser
+// XMenuCloser
//---------------------------------------------------------------------------------------------------------
void LayoutManager::implts_updateMenuBarClose()
{
@@ -2696,12 +2603,12 @@ void LayoutManager::implts_updateMenuBarClose()
if ( xContainerWindow.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
SystemWindow* pSysWindow = getTopSystemWindow( xContainerWindow );
if ( pSysWindow )
- {
- MenuBar* pMenuBar = pSysWindow->GetMenuBar();
+ {
+ MenuBar* pMenuBar = pSysWindow->GetMenuBar();
if ( pMenuBar )
{
// TODO remove link on FALSE ?!
@@ -2731,7 +2638,7 @@ sal_Bool LayoutManager::implts_resetMenuBar()
aWriteLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
SystemWindow* pSysWindow = getTopSystemWindow( xContainerWindow );
if ( pSysWindow && bMenuVisible && pSetMenuBar )
{
@@ -2817,7 +2724,7 @@ void LayoutManager::implts_notifyListeners( short nEvent, uno::Any aInfoParam )
}
//---------------------------------------------------------------------------------------------------------
-// XWindowListener
+// XWindowListener
//---------------------------------------------------------------------------------------------------------
void SAL_CALL LayoutManager::windowResized( const awt::WindowEvent& aEvent )
throw( uno::RuntimeException )
@@ -2940,7 +2847,7 @@ IMPL_LINK( LayoutManager, AsyncLayoutHdl, Timer *, EMPTYARG )
}
//---------------------------------------------------------------------------------------------------------
-// XFrameActionListener
+// XFrameActionListener
//---------------------------------------------------------------------------------------------------------
void SAL_CALL LayoutManager::frameAction( const FrameActionEvent& aEvent )
throw ( RuntimeException )
@@ -3020,9 +2927,7 @@ throw( RuntimeException )
xModuleCfgMgr->removeConfigurationListener(
Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
- catch ( Exception& )
- {
- }
+ catch ( Exception& ) {}
}
if ( m_xDocCfgMgr.is() )
@@ -3033,9 +2938,7 @@ throw( RuntimeException )
xDocCfgMgr->removeConfigurationListener(
Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
- catch ( Exception& )
- {
- }
+ catch ( Exception& ) {}
}
m_xDocCfgMgr.clear();
@@ -3043,7 +2946,7 @@ throw( RuntimeException )
m_xFrame.clear();
delete m_pGlobalSettings;
m_pGlobalSettings = 0;
- m_xDockingAreaAcceptor = Reference< ui::XDockingAreaAcceptor >();
+ m_xDockingAreaAcceptor = Reference< ui::XDockingAreaAcceptor >();
bDisposeAndClear = sal_True;
}
@@ -3053,10 +2956,10 @@ throw( RuntimeException )
uno::Reference< ui::XUIConfigurationListener > xToolbarManager( m_xToolbarManager );
ToolbarLayoutManager* pToolbarManager = m_pToolbarManager;
if ( pToolbarManager )
- {
- uno::Reference< awt::XWindowPeer > aEmptyWindowPeer;
+ {
+ uno::Reference< awt::XWindowPeer > aEmptyWindowPeer;
pToolbarManager->setParentWindow( aEmptyWindowPeer );
- }
+ }
impl_clearUpMenuBar();
m_xMenuBar.clear();
if ( m_xInplaceMenuBar.is() )
@@ -3194,7 +3097,7 @@ void SAL_CALL LayoutManager::elementRemoved( const ui::ConfigurationEvent& Event
}
// No settings anymore, element must be destroyed
- if ( xContainerWindow.is() && bNoSettings )
+ if ( xContainerWindow.is() && bNoSettings )
{
if ( aElementType.equalsIgnoreAsciiCaseAscii( "menubar" ) && aElementName.equalsIgnoreAsciiCaseAscii( "menubar" ))
{
@@ -3206,7 +3109,7 @@ void SAL_CALL LayoutManager::elementRemoved( const ui::ConfigurationEvent& Event
if ( xComp.is() )
xComp->dispose();
- WriteGuard aWriteLock( m_aLock );
+ WriteGuard aWriteLock( m_aLock );
m_xMenuBar.clear();
}
}
@@ -3234,13 +3137,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 );
@@ -3269,7 +3172,7 @@ void SAL_CALL LayoutManager::elementReplaced( const ui::ConfigurationEvent& Even
}
//---------------------------------------------------------------------------------------------------------
-// OPropertySetHelper
+// OPropertySetHelper
//---------------------------------------------------------------------------------------------------------
sal_Bool SAL_CALL LayoutManager::convertFastPropertyValue( Any& aConvertedValue,
Any& aOldValue,
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 9b1776a389..2ef819543a 100755
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -247,7 +247,7 @@ void ToolbarLayoutManager::doLayout(const ::Size& aContainerSize)
const sal_uInt32 nCount = aRowColumnsWindowData.size();
for ( sal_uInt32 j = 0; j < nCount; ++j )
{
- sal_uInt32 nIndex = bReverse ? nCount-j-1 : j;
+ sal_uInt32 nIndex = bReverse ? nCount-j-1 : j;
implts_calcWindowPosSizeOnSingleRowColumn( i, nOffset, aRowColumnsWindowData[nIndex], aContainerSize );
nOffset += aRowColumnsWindowData[j].nStaticSize;
}
@@ -300,10 +300,10 @@ Rectangle ToolbarLayoutManager::implts_calcDockingArea()
uno::Reference< awt::XDockableWindow > xDockWindow( xWindow, uno::UNO_QUERY );
if ( xWindow.is() && xDockWindow.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
- if ( pWindow && pWindow->IsVisible() && !xDockWindow->isFloating() )
+ if ( pWindow && !xDockWindow->isFloating() && pConstIter->m_bVisible )
{
awt::Rectangle aPosSize = xWindow->getPosSize();
if ( pConstIter->m_aDockedData.m_nDockedArea != nCurrDockingArea )
@@ -317,7 +317,7 @@ Rectangle ToolbarLayoutManager::implts_calcDockingArea()
if ( pConstIter->m_aDockedData.m_nDockedArea == nCurrDockingArea )
{
- if ( isHorizontalDockingArea( pConstIter->m_aDockedData.m_nDockedArea ))
+ if ( isHorizontalDockingArea( pConstIter->m_aDockedData.m_nDockedArea ))
{
if ( pConstIter->m_aDockedData.m_aPos.Y() > nCurrPos )
{
@@ -435,7 +435,7 @@ bool ToolbarLayoutManager::requestToolbar( const ::rtl::OUString& rResourceURL )
bool bCreateOrShowToolbar( aRequestedToolbar.m_bVisible & !aRequestedToolbar.m_bMasterHide );
uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow, uno::UNO_QUERY );
if ( xContainerWindow.is() && aRequestedToolbar.m_bFloating )
- bCreateOrShowToolbar &= xContainerWindow->isActive();
+ bCreateOrShowToolbar &= bool( xContainerWindow->isActive());
if ( bCreateOrShowToolbar )
bNotify = ( bMustCallCreate ) ? createToolbar( rResourceURL ) : showToolbar( rResourceURL );
@@ -471,10 +471,10 @@ bool ToolbarLayoutManager::destroyToolbar( const ::rtl::OUString& rResourceURL )
{
xComponent.set( pIter->m_xUIElement, uno::UNO_QUERY );
if ( bMustBeDestroyed )
- pIter->m_xUIElement.clear();
+ pIter->m_xUIElement.clear();
else
pIter->m_bVisible = false;
- break;
+ break;
}
}
aWriteLock.unlock();
@@ -486,7 +486,7 @@ bool ToolbarLayoutManager::destroyToolbar( const ::rtl::OUString& rResourceURL )
uno::Reference< awt::XDockableWindow > xDockWindow( xWindow, uno::UNO_QUERY );
if ( bMustBeDestroyed )
- {
+ {
try
{
if ( xWindow.is() )
@@ -505,7 +505,7 @@ bool ToolbarLayoutManager::destroyToolbar( const ::rtl::OUString& rResourceURL )
}
else
{
- if ( xWindow.is() )
+ if ( xWindow.is() )
xWindow->setVisible( sal_False );
bNotify = true;
}
@@ -534,9 +534,9 @@ bool ToolbarLayoutManager::destroyToolbar( const ::rtl::OUString& rResourceURL )
void ToolbarLayoutManager::destroyToolbars()
{
UIElementVector aUIElementVector;
-
+ implts_getUIElementVectorCopy( aUIElementVector );
+
WriteGuard aWriteLock( m_aLock );
- aUIElementVector = m_aUIElements;
m_aUIElements.clear();
m_bLayoutDirty = true;
aWriteLock.unlock();
@@ -554,12 +554,12 @@ bool ToolbarLayoutManager::showToolbar( const ::rtl::OUString& rResourceURL )
{
UIElement aUIElement = implts_findToolbar( rResourceURL );
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = getWindowFromXUIElement( aUIElement.m_xUIElement );
if ( pWindow )
{
if ( !aUIElement.m_bFloating )
- implts_setLayoutDirty();
+ implts_setLayoutDirty();
else
pWindow->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
@@ -576,13 +576,13 @@ bool ToolbarLayoutManager::hideToolbar( const ::rtl::OUString& rResourceURL )
{
UIElement aUIElement = implts_findToolbar( rResourceURL );
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = getWindowFromXUIElement( aUIElement.m_xUIElement );
if ( pWindow )
{
pWindow->Show( FALSE );
if ( !aUIElement.m_bFloating )
- implts_setLayoutDirty();
+ implts_setLayoutDirty();
aUIElement.m_bVisible = false;
implts_writeWindowStateData( aUIElement );
@@ -595,24 +595,22 @@ bool ToolbarLayoutManager::hideToolbar( const ::rtl::OUString& rResourceURL )
void ToolbarLayoutManager::refreshToolbarsVisibility()
{
- ReadGuard aReadLock( m_aLock );
- UIElementVector aUIElementVector = m_aUIElements;
- aReadLock.unlock();
-
- UIElementVector::iterator pIter;
+ UIElementVector aUIElementVector;
+ implts_getUIElementVectorCopy( aUIElementVector );
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ 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 ( pIter->m_bVisible && !pIter->m_bMasterHide )
- {
- if ( pIter->m_bFloating )
+ {
+ if ( pIter->m_bFloating )
pWindow->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
else
- implts_setLayoutDirty();
+ implts_setLayoutDirty();
}
else
pWindow->Show( FALSE );
@@ -622,12 +620,11 @@ void ToolbarLayoutManager::refreshToolbarsVisibility()
void ToolbarLayoutManager::setFloatingToolbarsVisibility( bool bVisible )
{
- WriteGuard aWriteLock( m_aLock );
- UIElementVector aUIElementVector( m_aUIElements );
- aWriteLock.unlock();
+ UIElementVector aUIElementVector;
+ implts_getUIElementVectorCopy( aUIElementVector );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
UIElementVector::iterator pIter;
- vos::OGuard aGuard( Application::GetSolarMutex() );
for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); pIter++ )
{
Window* pWindow = getWindowFromXUIElement( pIter->m_xUIElement );
@@ -646,31 +643,32 @@ void ToolbarLayoutManager::setFloatingToolbarsVisibility( bool bVisible )
void ToolbarLayoutManager::setVisible( bool bVisible )
{
- WriteGuard aWriteLock( m_aLock );
- UIElementVector aUIElementVector( m_aUIElements );
- bool bLayoutInProgress = m_bLayoutInProgress;
- m_bLayoutDirty = true;
- m_bLayoutInProgress = true;
- aWriteLock.unlock();
-
- UIElementVector::iterator pIter;
+ UIElementVector aUIElementVector;
+ implts_getUIElementVectorCopy( aUIElementVector );
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+ UIElementVector::iterator pIter;
for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); pIter++ )
{
- bool bToolbarVisible = pIter->m_bVisible;
-
pIter->m_bMasterHide = !bVisible;
Window* pWindow = getWindowFromXUIElement( pIter->m_xUIElement );
- if ( pWindow && pIter->m_bFloating )
- pWindow->Show(bVisible & bToolbarVisible, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ if ( pWindow )
+ {
+ bool bSetVisible( pIter->m_bVisible & bVisible );
+ if ( !bSetVisible )
+ pWindow->Hide();
+ else
+ {
+ if ( pIter->m_bFloating )
+ pWindow->Show(true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ else
+ implts_setLayoutDirty();
+ }
+ }
}
if ( !bVisible )
resetDockingArea();
-
- aWriteLock.lock();
- m_bLayoutInProgress = bLayoutInProgress;
}
bool ToolbarLayoutManager::dockToolbar( const ::rtl::OUString& rResourceURL, ui::DockingArea eDockingArea, const awt::Point& aPos )
@@ -681,11 +679,11 @@ bool ToolbarLayoutManager::dockToolbar( const ::rtl::OUString& rResourceURL, ui:
{
try
{
- uno::Reference< awt::XWindow > xWindow( aUIElement.m_xUIElement->getRealInterface(), uno::UNO_QUERY );
- uno::Reference< awt::XDockableWindow > xDockWindow( xWindow, uno::UNO_QUERY );
+ uno::Reference< awt::XWindow > xWindow( aUIElement.m_xUIElement->getRealInterface(), uno::UNO_QUERY );
+ uno::Reference< awt::XDockableWindow > xDockWindow( xWindow, uno::UNO_QUERY );
if ( xDockWindow.is() )
{
- if ( eDockingArea != ui::DockingArea_DOCKINGAREA_DEFAULT )
+ if ( eDockingArea != ui::DockingArea_DOCKINGAREA_DEFAULT )
aUIElement.m_aDockedData.m_nDockedArea = sal_Int16( eDockingArea );
if ( !isDefaultPos( aPos ))
@@ -744,7 +742,7 @@ bool ToolbarLayoutManager::dockToolbar( const ::rtl::OUString& rResourceURL, ui:
implts_sortUIElements();
if ( aUIElement.m_bVisible )
- implts_setLayoutDirty();
+ implts_setLayoutDirty();
}
return true;
}
@@ -798,7 +796,7 @@ long ToolbarLayoutManager::childWindowEvent( VclSimpleEvent* pEvent )
ToolBox* pToolBox = getToolboxPtr( ((VclWindowEvent*)pEvent)->GetWindow() );
if ( pToolBox )
- {
+ {
aToolbarName = retrieveToolbarNameFromHelpURL( pToolBox );
USHORT nId = pToolBox->GetCurItemId();
if ( nId > 0 )
@@ -815,7 +813,7 @@ long ToolbarLayoutManager::childWindowEvent( VclSimpleEvent* pEvent )
{
if ( pIter->m_xUIElement.is() )
{
- uno::Reference< ui::XUIFunctionListener > xListener( pIter->m_xUIElement, uno::UNO_QUERY );
+ uno::Reference< ui::XUIFunctionListener > xListener( pIter->m_xUIElement, uno::UNO_QUERY );
if ( xListener.is() )
aListenerArray.push_back( xListener );
}
@@ -834,16 +832,22 @@ long ToolbarLayoutManager::childWindowEvent( VclSimpleEvent* pEvent )
else if ( pEvent->GetId() == VCLEVENT_TOOLBOX_FORMATCHANGED )
{
ToolBox* pToolBox = getToolboxPtr( ((VclWindowEvent*)pEvent)->GetWindow() );
-
if ( pToolBox )
{
::rtl::OUString aToolbarName = retrieveToolbarNameFromHelpURL( pToolBox );
-
if ( aToolbarName.getLength() > 0 )
{
- implts_setLayoutDirty();
- m_pParentLayouter->requestLayout( ILayoutNotifications::HINT_TOOLBARSPACE_HAS_CHANGED );
- }
+ ::rtl::OUStringBuffer aBuf(100);
+ aBuf.appendAscii( "private:resource/toolbar/" );
+ aBuf.append( aToolbarName );
+
+ UIElement aToolbar = implts_findToolbar( aBuf.makeStringAndClear() );
+ if ( aToolbar.m_xUIElement.is() && !aToolbar.m_bFloating )
+ {
+ implts_setLayoutDirty();
+ m_pParentLayouter->requestLayout( ILayoutNotifications::HINT_TOOLBARSPACE_HAS_CHANGED );
+ }
+ }
}
}
}
@@ -854,10 +858,10 @@ long ToolbarLayoutManager::childWindowEvent( VclSimpleEvent* pEvent )
void ToolbarLayoutManager::resetDockingArea()
{
ReadGuard aReadLock( m_aLock );
- uno::Reference< awt::XWindow > xTopDockingWindow = m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_TOP];
- uno::Reference< awt::XWindow > xLeftDockingWindow = m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_LEFT];
- uno::Reference< awt::XWindow > xRightDockingWindow = m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_RIGHT];
- uno::Reference< awt::XWindow > xBottomDockingWindow = m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_BOTTOM];
+ uno::Reference< awt::XWindow > xTopDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_TOP] );
+ uno::Reference< awt::XWindow > xLeftDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_LEFT] );
+ uno::Reference< awt::XWindow > xRightDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_RIGHT] );
+ uno::Reference< awt::XWindow > xBottomDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_BOTTOM] );
aReadLock.unlock();
if ( xTopDockingWindow.is() )
@@ -1009,7 +1013,7 @@ void ToolbarLayoutManager::implts_createAddonsToolBars()
if ( xWindow.is() )
{
// Set generic title for add-on toolbar
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow->GetText().Len() == 0 )
pWindow->SetText( aGenericAddonTitle );
@@ -1158,7 +1162,7 @@ void ToolbarLayoutManager::implts_createCustomToolBar( const rtl::OUString& aTbx
if ( aTitle && xUIElement.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = getWindowFromXUIElement( xUIElement );
if ( pWindow )
@@ -1178,7 +1182,7 @@ void ToolbarLayoutManager::implts_reparentToolbars()
Window* pRightDockWindow = VCLUnoHelper::GetWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_RIGHT] );
aWriteLock.unlock();
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
if ( pContainerWindow )
{
UIElementVector::iterator pIter;
@@ -1238,6 +1242,7 @@ void ToolbarLayoutManager::implts_createToolBar( const ::rtl::OUString& aName, b
{
uno::Reference< ui::XUIElement > xUIElement = implts_createElement( aName );
bool bVisible( false );
+ bool bFloating( false );
if ( xUIElement.is() )
{
rUIElement = xUIElement;
@@ -1268,6 +1273,7 @@ void ToolbarLayoutManager::implts_createToolBar( const ::rtl::OUString& aName, b
implts_setElementData( rElement, xDockWindow );
rElement.m_xUIElement = xUIElement;
bVisible = rElement.m_bVisible;
+ bFloating = rElement.m_bFloating;
}
else
{
@@ -1277,6 +1283,7 @@ void ToolbarLayoutManager::implts_createToolBar( const ::rtl::OUString& aName, b
implts_setElementData( aNewToolbar, xDockWindow );
implts_insertToolbar( aNewToolbar );
bVisible = aNewToolbar.m_bVisible;
+ bFloating = rElement.m_bFloating;
}
aWriteLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -1284,7 +1291,7 @@ void ToolbarLayoutManager::implts_createToolBar( const ::rtl::OUString& aName, b
// set toolbar menu style according to customize command state
SvtCommandOptions aCmdOptions;
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX )
{
@@ -1295,12 +1302,13 @@ void ToolbarLayoutManager::implts_createToolBar( const ::rtl::OUString& aName, b
else
pToolbar->SetMenuType( nMenuType | TOOLBOX_MENUTYPE_CUSTOMIZE );
}
- }
-
- implts_sortUIElements();
+ bNotify = true;
+
+ implts_sortUIElements();
- if ( bVisible )
- implts_setLayoutDirty();
+ if ( bVisible && !bFloating )
+ implts_setLayoutDirty();
+ }
}
}
@@ -1343,7 +1351,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno
if ( xDockWindow.is() && xWindow.is() )
{
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow )
{
@@ -1452,8 +1460,8 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno
if ( pWindow )
{
vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( !bShowElement )
- pWindow->Hide();
+ if ( !bShowElement )
+ pWindow->Hide();
}
}
}
@@ -1799,7 +1807,7 @@ uno::Reference< awt::XWindow > ToolbarLayoutManager::implts_getXWindow( const ::
{
if ( pIter->m_aName == aName && pIter->m_xUIElement.is() )
{
- xWindow = uno::Reference< awt::XWindow >( pIter->m_xUIElement->getRealInterface(), uno::UNO_QUERY );
+ xWindow = uno::Reference< awt::XWindow >( pIter->m_xUIElement->getRealInterface(), uno::UNO_QUERY );
break;
}
}
@@ -1929,6 +1937,12 @@ void ToolbarLayoutManager::implts_sortUIElements()
aWriteLock.unlock();
}
+void ToolbarLayoutManager::implts_getUIElementVectorCopy( UIElementVector& rCopy )
+{
+ ReadGuard aReadLock( m_aLock );
+ rCopy = m_aUIElements;
+}
+
::Size ToolbarLayoutManager::implts_getTopBottomDockingAreaSizes()
{
::Size aSize;
@@ -2158,7 +2172,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( ui::D
uno::Reference< awt::XWindow > xWindow( xUIElement->getRealInterface(), uno::UNO_QUERY );
if ( xWindow.is() )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ 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 )
@@ -2578,7 +2592,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn(
awt::Rectangle& rWinRect = rRowColumnWindowData.aRowColumnWindowSizes[i];
::Size aMinSize;
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
{
uno::Reference< awt::XWindow > xWindow = rRowColumnWindowData.aRowColumnWindows[i];
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
@@ -2588,7 +2602,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn(
if (( aMinSize.Width() > 0 ) && ( aMinSize.Height() > 0 ))
{
- if ( isHorizontalDockingArea( nDockingArea ))
+ if ( isHorizontalDockingArea( nDockingArea ))
{
sal_Int32 nMaxReducation = ( rWinRect.Width - aMinSize.Width() );
if ( nMaxReducation >= -nDiff )
@@ -2639,7 +2653,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn(
sal_Int32 nCurrPos( 0 );
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
uno::Reference< awt::XWindow > xWindow = rRowColumnWindowData.aRowColumnWindows[i];
@@ -3178,7 +3192,7 @@ framework::ToolbarLayoutManager::DockingOperation ToolbarLayoutManager::implts_d
Window* pDockingAreaWindow( 0 );
Window* pContainerWindow( 0 );
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
pDockingAreaWindow = VCLUnoHelper::GetWindow( xDockingAreaWindow );
pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
nDockPosY = pDockingAreaWindow->ScreenToOutputPixel( pContainerWindow->OutputToScreenPixel( ::Point( 0, nPosY ))).Y();
@@ -3222,7 +3236,7 @@ void ToolbarLayoutManager::implts_renumberRowColumnData(
if (( pIter->m_aDockedData.m_nDockedArea == sal_Int16( eDockingArea )) && ( pIter->m_aName != rUIElement.m_aName ))
{
// Don't change toolbars without a valid docking position!
- if ( isDefaultPos( pIter->m_aDockedData.m_aPos ))
+ if ( isDefaultPos( pIter->m_aDockedData.m_aPos ))
continue;
sal_Int32 nWindowRowCol = ( bHorzDockingArea ) ? pIter->m_aDockedData.m_aPos.Y() : pIter->m_aDockedData.m_aPos.X();
@@ -3330,7 +3344,7 @@ throw( uno::RuntimeException )
}
else
{
- implts_setLayoutDirty();
+ implts_setLayoutDirty();
bNotify = true;
}
}
@@ -3393,7 +3407,7 @@ throw (uno::RuntimeException)
aUIElement.m_aFloatingData.m_aPos = ::Point( aPos.X, aPos.Y );
aUIElement.m_aFloatingData.m_aSize = ::Size( aSize.Width, aSize.Height );
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX )
{
@@ -3439,7 +3453,7 @@ throw (uno::RuntimeException)
{
try
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
sal_Int16 eDockingArea( -1 ); // none
sal_Int32 nMagneticZone( aUIDockingElement.m_bFloating ? MAGNETIC_DISTANCE_DOCK : MAGNETIC_DISTANCE_UNDOCK );
@@ -3704,11 +3718,11 @@ throw (uno::RuntimeException)
if ( xDockWindow->isFloating() )
{
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX )
{
- ToolBox* pToolBox = static_cast< ToolBox *>( pWindow );
+ ToolBox* pToolBox = static_cast< ToolBox *>( pWindow );
aUIDockingElement.m_aFloatingData.m_aPos = pToolBox->GetPosPixel();
aUIDockingElement.m_aFloatingData.m_aSize = pToolBox->GetOutputSizePixel();
aUIDockingElement.m_aFloatingData.m_nLines = pToolBox->GetFloatingLines();
@@ -3794,7 +3808,7 @@ throw (uno::RuntimeException)
}
else
{
- if ( isDefaultPos( aUIDockingElement.m_aDockedData.m_aPos ))
+ if ( isDefaultPos( aUIDockingElement.m_aDockedData.m_aPos ))
{
// Docking on its default position without a preset position -
// we have to find a good place for it.
@@ -3831,7 +3845,7 @@ throw (uno::RuntimeException)
implts_sortUIElements();
implts_setLayoutDirty();
- aReadLock.lock();
+ aReadLock.lock();
ILayoutNotifications* pParentLayouter( m_pParentLayouter );
aReadLock.unlock();
@@ -3870,7 +3884,7 @@ throw (uno::RuntimeException)
uno::Reference< ui::XUIElement > xUIElement( pIter->m_xUIElement );
if ( xUIElement.is() )
{
- uno::Reference< uno::XInterface > xIfac( xUIElement->getRealInterface(), uno::UNO_QUERY );
+ uno::Reference< uno::XInterface > xIfac( xUIElement->getRealInterface(), uno::UNO_QUERY );
if ( xIfac == e.Source )
{
aName = pIter->m_aName;
@@ -3950,7 +3964,7 @@ throw (uno::RuntimeException)
catch ( lang::WrappedTargetException& ) {}
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = getWindowFromXUIElement( xUIElement );
if ( pWindow )
pWindow->SetText( aUIName );
@@ -3990,7 +4004,7 @@ throw (uno::RuntimeException)
if ( rEvent.Source == xElementCfgMgr )
{
// Same UI configuration manager where our element has its settings
- if ( rEvent.Source == uno::Reference< uno::XInterface >( xDocCfgMgr, uno::UNO_QUERY ))
+ if ( rEvent.Source == uno::Reference< uno::XInterface >( xDocCfgMgr, uno::UNO_QUERY ))
{
// document settings removed
if ( xModuleCfgMgr->hasSettings( rEvent.ResourceURL ))
@@ -4006,7 +4020,7 @@ throw (uno::RuntimeException)
// No settings anymore, element must be destroyed
if ( xContainerWindow.is() && bNoSettings )
- destroyToolbar( rEvent.ResourceURL );
+ destroyToolbar( rEvent.ResourceURL );
}
}
@@ -4063,7 +4077,7 @@ uno::Sequence< uno::Reference< ui::XUIElement > > ToolbarLayoutManager::getToolb
{
if ( pIter->m_xUIElement.is() )
{
- ++nCount;
+ ++nCount;
aSeq.realloc( nCount );
aSeq[nCount-1] = pIter->m_xUIElement;
}
@@ -4080,7 +4094,7 @@ bool ToolbarLayoutManager::floatToolbar( const ::rtl::OUString& rResourceURL )
{
try
{
- uno::Reference< awt::XDockableWindow > xDockWindow( aUIElement.m_xUIElement->getRealInterface(), uno::UNO_QUERY );
+ uno::Reference< awt::XDockableWindow > xDockWindow( aUIElement.m_xUIElement->getRealInterface(), uno::UNO_QUERY );
if ( xDockWindow.is() && !xDockWindow->isFloating() )
{
aUIElement.m_bFloating = true;
@@ -4105,7 +4119,7 @@ bool ToolbarLayoutManager::lockToolbar( const ::rtl::OUString& rResourceURL )
{
try
{
- uno::Reference< awt::XDockableWindow > xDockWindow( aUIElement.m_xUIElement->getRealInterface(), uno::UNO_QUERY );
+ uno::Reference< awt::XDockableWindow > xDockWindow( aUIElement.m_xUIElement->getRealInterface(), uno::UNO_QUERY );
if ( xDockWindow.is() && !xDockWindow->isFloating() && !xDockWindow->isLocked() )
{
aUIElement.m_aDockedData.m_bLocked = true;
@@ -4116,7 +4130,7 @@ bool ToolbarLayoutManager::lockToolbar( const ::rtl::OUString& rResourceURL )
implts_setToolbar( aUIElement );
return true;
}
- }
+ }
catch ( lang::DisposedException& ) {}
}
@@ -4130,7 +4144,7 @@ bool ToolbarLayoutManager::unlockToolbar( const ::rtl::OUString& rResourceURL )
{
try
{
- uno::Reference< awt::XDockableWindow > xDockWindow( aUIElement.m_xUIElement->getRealInterface(), uno::UNO_QUERY );
+ uno::Reference< awt::XDockableWindow > xDockWindow( aUIElement.m_xUIElement->getRealInterface(), uno::UNO_QUERY );
if ( xDockWindow.is() && !xDockWindow->isFloating() && xDockWindow->isLocked() )
{
aUIElement.m_aDockedData.m_bLocked = false;
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.hxx b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
index 3279ae78c5..670ef678d2 100755
--- a/framework/source/layoutmanager/toolbarlayoutmanager.hxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
@@ -252,6 +252,7 @@ class ToolbarLayoutManager : public ::cppu::WeakImplHelper3< ::com::sun::star::a
bool implts_insertToolbar( const UIElement& rUIElement );
void implts_setToolbar( const UIElement& rUIElement );
::Size implts_getTopBottomDockingAreaSizes();
+ void implts_getUIElementVectorCopy( UIElementVector& rCopy );
//---------------------------------------------------------------------------------------------------------
// internal docking methods