diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-07 11:48:47 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-07 17:53:04 +0200 |
commit | 5a824268dfdd48c00f656b767b48cd12ccbdaabb (patch) | |
tree | a25f4afd3ca49cff41fc44559aedea70c82e6c7e /forms/source/component/DatabaseForm.cxx | |
parent | a6186a678cd9f67359da885606b3c3983f6bdc74 (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/source/component/DatabaseForm.cxx')
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 16 |
1 files changed, 8 insertions, 8 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 |