From 5a824268dfdd48c00f656b767b48cd12ccbdaabb Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 7 Apr 2019 11:48:47 +0300 Subject: 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 --- UnoControls/source/controls/progressmonitor.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'UnoControls/source/controls/progressmonitor.cxx') diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx index 7e439beb5e60..23451ac5c2a9 100644 --- a/UnoControls/source/controls/progressmonitor.cxx +++ b/UnoControls/source/controls/progressmonitor.cxx @@ -799,19 +799,19 @@ IMPL_TextlistItem* ProgressMonitor::impl_searchTopic ( const OUString& rTopic, b ::std::vector< std::unique_ptr >* pTextList; // Ready for multithreading - ClearableMutexGuard aGuard ( m_aMutex ); - - if ( bbeforeProgress ) { - pTextList = &maTextlist_Top; - } - else - { - pTextList = &maTextlist_Bottom; - } + MutexGuard aGuard(m_aMutex); + if (bbeforeProgress) + { + pTextList = &maTextlist_Top; + } + else + { + pTextList = &maTextlist_Bottom; + } + } // Switch off guard. - aGuard.clear (); // Search the topic in textlist. size_t nPosition = 0; -- cgit