summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx92
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx22
2 files changed, 60 insertions, 54 deletions
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 16b7e099b3c6..274c595ce42c 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -1520,60 +1520,62 @@ void SAL_CALL LayoutManager::destroyElement( const OUString& aName )
{
SAL_INFO( "fwk", "framework (cd100003) ::LayoutManager::destroyElement" );
+ bool bMustBeLayouted(false);
+ bool bNotify(false);
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- SolarMutexClearableGuard aWriteLock;
+ {
+ SolarMutexClearableGuard aWriteLock;
- bool bMustBeLayouted( false );
- bool bNotify( false );
- OUString aElementType;
- OUString aElementName;
+ OUString aElementType;
+ OUString aElementName;
- parseResourceURL( aName, aElementType, aElementName );
+ parseResourceURL(aName, aElementType, aElementName);
- if ( aElementType.equalsIgnoreAsciiCase("menubar") &&
- aElementName.equalsIgnoreAsciiCase("menubar") )
- {
- if ( !m_bInplaceMenuSet )
+ if (aElementType.equalsIgnoreAsciiCase("menubar")
+ && aElementName.equalsIgnoreAsciiCase("menubar"))
{
- impl_clearUpMenuBar();
- m_xMenuBar.clear();
+ if (!m_bInplaceMenuSet)
+ {
+ impl_clearUpMenuBar();
+ m_xMenuBar.clear();
+ bNotify = true;
+ }
+ }
+ else if ((aElementType.equalsIgnoreAsciiCase("statusbar")
+ && aElementName.equalsIgnoreAsciiCase("statusbar"))
+ || (m_aStatusBarElement.m_aName == aName))
+ {
+ aWriteLock.clear();
+ implts_destroyStatusBar();
+ bMustBeLayouted = true;
bNotify = true;
}
- }
- else if (( aElementType.equalsIgnoreAsciiCase("statusbar") &&
- aElementName.equalsIgnoreAsciiCase("statusbar") ) ||
- ( m_aStatusBarElement.m_aName == aName ))
- {
- aWriteLock.clear();
- implts_destroyStatusBar();
- bMustBeLayouted = true;
- bNotify = true;
- }
- else if ( aElementType.equalsIgnoreAsciiCase("progressbar") &&
- aElementName.equalsIgnoreAsciiCase("progressbar") )
- {
- aWriteLock.clear();
- implts_createProgressBar();
- bMustBeLayouted = true;
- bNotify = true;
- }
- else if ( aElementType.equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR ) && m_xToolbarManager.is() )
- {
- aWriteLock.clear();
- bNotify = m_xToolbarManager->destroyToolbar( aName );
- bMustBeLayouted = m_xToolbarManager->isLayoutDirty();
- }
- else if ( aElementType.equalsIgnoreAsciiCase("dockingwindow"))
- {
- uno::Reference< frame::XFrame > xFrame( m_xFrame );
- uno::Reference< XComponentContext > xContext( m_xContext );
- aWriteLock.clear();
+ else if (aElementType.equalsIgnoreAsciiCase("progressbar")
+ && aElementName.equalsIgnoreAsciiCase("progressbar"))
+ {
+ aWriteLock.clear();
+ implts_createProgressBar();
+ bMustBeLayouted = true;
+ bNotify = true;
+ }
+ else if (aElementType.equalsIgnoreAsciiCase(UIRESOURCETYPE_TOOLBAR)
+ && m_xToolbarManager.is())
+ {
+ aWriteLock.clear();
+ bNotify = m_xToolbarManager->destroyToolbar(aName);
+ bMustBeLayouted = m_xToolbarManager->isLayoutDirty();
+ }
+ else if (aElementType.equalsIgnoreAsciiCase("dockingwindow"))
+ {
+ uno::Reference<frame::XFrame> xFrame(m_xFrame);
+ uno::Reference<XComponentContext> xContext(m_xContext);
+ aWriteLock.clear();
- impl_setDockingWindowVisibility( xContext, xFrame, aElementName, false );
- bMustBeLayouted = false;
- bNotify = false;
+ impl_setDockingWindowVisibility(xContext, xFrame, aElementName, false);
+ bMustBeLayouted = false;
+ bNotify = false;
+ }
}
- aWriteLock.clear();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
if ( bMustBeLayouted )
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index aca93c4e2f03..d5708db9e895 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -440,12 +440,13 @@ bool ToolbarLayoutManager::createToolbar( const OUString& rResourceURL )
{
bool bNotify( false );
- SolarMutexClearableGuard aReadLock;
- uno::Reference< frame::XFrame > xFrame( m_xFrame );
- uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow );
- aReadLock.clear();
-
- bNotify = false;
+ uno::Reference<frame::XFrame> xFrame;
+ uno::Reference<awt::XWindow2> xContainerWindow;
+ {
+ SolarMutexGuard aReadLock;
+ xFrame.set(m_xFrame);
+ xContainerWindow.set(m_xContainerWindow);
+ }
if ( !xFrame.is() || !xContainerWindow.is() )
return false;
@@ -457,11 +458,14 @@ bool ToolbarLayoutManager::createToolbar( const OUString& rResourceURL )
uno::Sequence< beans::PropertyValue > aPropSeq( 2 );
aPropSeq[0].Name = "Frame";
- aPropSeq[0].Value <<= m_xFrame;
+ aPropSeq[0].Value <<= xFrame;
aPropSeq[1].Name = "Persistent";
aPropSeq[1].Value <<= true;
- uno::Reference< ui::XUIElementFactory > xUIElementFactory( m_xUIElementFactoryManager );
- aReadLock.clear();
+ uno::Reference<ui::XUIElementFactory> xUIElementFactory;
+ {
+ SolarMutexGuard aReadLock;
+ xUIElementFactory.set(m_xUIElementFactoryManager);
+ }
implts_setToolbarCreation();
try