summaryrefslogtreecommitdiff
path: root/framework/source/layoutmanager/layoutmanager.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-04-07 15:29:35 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2019-04-09 21:34:07 +0200
commitd38f9934f08939032cca64a32de58fa3901a88d5 (patch)
treee853e4ad432ec1c8eb08bb4d430835682cda6b90 /framework/source/layoutmanager/layoutmanager.cxx
parentc1e320836b7dbcd9fe6ded8352355ea6101bd821 (diff)
[API CHANGE] Asserts to never clear already cleared guard
... which could help catch copy-paste errors when wrong guard is cleared second time. Also an assert added that when resetting, there's something to reset (i.e., no descendant class had cleared protected pResetT, making reset impossible, and thus actually unable to guard anything). framework/source/layoutmanager/layoutmanager.cxx: made sure to not call clear() second time framework/source/layoutmanager/toolbarlayoutmanager.cxx: restored lock lost in commit 777bc22ca6490a4300f30fc1b45287dce789a36f forms/source/misc/InterfaceContainer.cxx: removed a leftover from commit a19cd21e3c03559877428315bebc0ceaf367a461 which reduced guarded scope forms/source/component/DatabaseForm.cxx: fixed clear-reset sequence broken from the initial commit bf4154eb5307ec8c35f000fd1df39ef3abb2eb6d Change-Id: Ibab6660c79561eee31faf3e6c1128ab141a7e8a3 Reviewed-on: https://gerrit.libreoffice.org/70381 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'framework/source/layoutmanager/layoutmanager.cxx')
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx92
1 files changed, 47 insertions, 45 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 )