summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-04-07 11:48:47 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-04-07 17:53:04 +0200
commit5a824268dfdd48c00f656b767b48cd12ccbdaabb (patch)
treea25f4afd3ca49cff41fc44559aedea70c82e6c7e /forms
parenta6186a678cd9f67359da885606b3c3983f6bdc74 (diff)
Don't use resettable/clearable guard where plain guard is enough
Also use scope where possible. This allows to limit guard scope at language level; visualises the scope clearly; and helps avoiding errors like fixed in commit 61e4437c857854b331fa01da6f39b2b3b58a800b. Change-Id: Ifeca96e2df8e8a0897770d9546b2536806275f41 Reviewed-on: https://gerrit.libreoffice.org/70376 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/DatabaseForm.cxx16
-rw-r--r--forms/source/component/FormComponent.cxx6
-rw-r--r--forms/source/component/ListBox.cxx2
3 files changed, 12 insertions, 12 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 39bbcbf411de..30795285a12d 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -1877,7 +1877,7 @@ Any ODatabaseForm::getPropertyDefaultByHandle( sal_Int32 nHandle ) const
void SAL_CALL ODatabaseForm::reset()
{
- ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
if (isLoaded())
{
@@ -2304,7 +2304,7 @@ void ODatabaseForm::_propertyChanged(const PropertyChangeEvent& evt)
void SAL_CALL ODatabaseForm::setParent(const css::uno::Reference<css::uno::XInterface>& Parent)
{
// SYNCHRONIZED ----->
- ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
Reference<XForm> xParentForm(getParent(), UNO_QUERY);
if (xParentForm.is())
@@ -2364,7 +2364,7 @@ void SAL_CALL ODatabaseForm::setParent(const css::uno::Reference<css::uno::XInte
sal_Bool SAL_CALL ODatabaseForm::getGroupControl()
{
- ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
// Should controls be combined into a TabOrder group?
if (m_aCycle.hasValue())
@@ -2383,7 +2383,7 @@ sal_Bool SAL_CALL ODatabaseForm::getGroupControl()
void SAL_CALL ODatabaseForm::setControlModels(const Sequence<Reference<XControlModel> >& rControls)
{
- ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
// Set TabIndex in the order of the sequence
sal_Int32 nCount = getCount();
@@ -2968,7 +2968,7 @@ void SAL_CALL ODatabaseForm::cursorMoved(const EventObject& /*event*/)
{
// reload the subform with the new parameters of the parent
// do this handling delayed to provide of execute too many SQL Statements
- ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
DBG_ASSERT( m_pLoadTimer, "ODatabaseForm::cursorMoved: how can this happen?!" );
if ( !m_pLoadTimer )
@@ -3158,7 +3158,7 @@ sal_Bool SAL_CALL ODatabaseForm::approveRowSetChange(const EventObject& event)
void SAL_CALL ODatabaseForm::addRowSetApproveListener(const Reference<XRowSetApproveListener>& _rListener)
{
- ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
m_aRowSetApproveListeners.addInterface(_rListener);
// do we have to multiplex ?
@@ -3176,7 +3176,7 @@ void SAL_CALL ODatabaseForm::addRowSetApproveListener(const Reference<XRowSetApp
void SAL_CALL ODatabaseForm::removeRowSetApproveListener(const Reference<XRowSetApproveListener>& _rListener)
{
- ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
// do we have to remove the multiplex ?
m_aRowSetApproveListeners.removeInterface(_rListener);
if ( m_aRowSetApproveListeners.getLength() == 0 )
@@ -3244,7 +3244,7 @@ void SAL_CALL ODatabaseForm::executeWithCompletion( const Reference< XInteractio
void SAL_CALL ODatabaseForm::execute()
{
- ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
// if somebody calls an execute and we're not loaded we reroute this call to our load method.
// the difference between execute and load is, that we position on the first row in case of load
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 4ab830b7f5a4..0832a64031bf 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -1344,7 +1344,7 @@ void OBoundControlModel::disposing()
{
OControlModel::disposing();
- ::osl::ClearableMutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
if ( m_pAggPropMultiplexer )
m_pAggPropMultiplexer->dispose();
@@ -2697,7 +2697,7 @@ void OBoundControlModel::disconnectValidator( )
void SAL_CALL OBoundControlModel::setValidator( const Reference< XValidator >& _rxValidator )
{
- ::osl::ClearableMutexGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
OSL_PRECOND( m_bSupportsValidation, "OBoundControlModel::setValidator: How did you reach this method?" );
// the interface for this method should not have been exposed if we do not
// support validation
@@ -2733,7 +2733,7 @@ Reference< XValidator > SAL_CALL OBoundControlModel::getValidator( )
void SAL_CALL OBoundControlModel::validityConstraintChanged( const EventObject& /*Source*/ )
{
- ::osl::ClearableMutexGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
OSL_PRECOND( m_bSupportsValidation, "OBoundControlModel::validityConstraintChanged: How did you reach this method?" );
// the interface for this method should not have been exposed if we do not
// support validation
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index fcf16abe66b4..9194f846692f 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -1907,7 +1907,7 @@ namespace frm
m_aItemListeners.notifyEach( &XItemListener::itemStateChanged, _rEvent );
// and do the handling for the ChangeListeners
- ::osl::ClearableMutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
if ( m_aChangeIdle.IsActive() )
{
Reference<XPropertySet> xSet(getModel(), UNO_QUERY);