summaryrefslogtreecommitdiff
path: root/forms
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 /forms
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 'forms')
-rw-r--r--forms/source/component/DatabaseForm.cxx3
-rw-r--r--forms/source/misc/InterfaceContainer.cxx1
2 files changed, 1 insertions, 3 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 30795285a12d..378ee9dc04c9 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -2853,16 +2853,15 @@ void SAL_CALL ODatabaseForm::unload()
// close the aggregate
Reference<XCloseable> xCloseable;
query_aggregation( m_xAggregate, xCloseable);
- aGuard.clear();
if (xCloseable.is())
xCloseable->close();
}
catch(const SQLException&)
{
}
- aGuard.reset();
}
+ aGuard.reset();
m_bLoaded = false;
// if the connection we used while we were loaded is only shared with our parent, we
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index 36756bdfeae2..e4ddc4265113 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -855,7 +855,6 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper
aEvt.Accessor <<= _nIndex;
aEvt.Element = pElementMetaData->aElementTypeInterface;
- aGuard.clear();
m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvt );
}
}