summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-08-03 11:36:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-03 12:20:53 +0200
commit05ab38359ae72f2a54dc0b5f1b84ac5f649c507a (patch)
tree5830c7ee2442984e0bc804def7bd95ddd8a25410 /sc/source
parent5afdcad4c0e7850b18996c549892b9360cd8973f (diff)
Consolidate on C++17 std::scoped_lock instead of std::lock_guard
as in commit 9376f65a26240441bf9dd6ae1f69886dc9fa60fa Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/mtvelements.cxx4
-rw-r--r--sc/source/core/data/poolhelp.cxx2
-rw-r--r--sc/source/core/tool/editutil.cxx2
-rw-r--r--sc/source/core/tool/refreshtimer.cxx4
-rw-r--r--sc/source/filter/oox/formulabuffer.cxx2
5 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/core/data/mtvelements.cxx b/sc/source/core/data/mtvelements.cxx
index 865d37bf2933..c7d7e52bfccf 100644
--- a/sc/source/core/data/mtvelements.cxx
+++ b/sc/source/core/data/mtvelements.cxx
@@ -55,7 +55,7 @@ ColumnBlockPositionSet::ColumnBlockPositionSet(ScDocument& rDoc) : mrDoc(rDoc) {
ColumnBlockPosition* ColumnBlockPositionSet::getBlockPosition(SCTAB nTab, SCCOL nCol)
{
- std::lock_guard aGuard(maMtxTables);
+ std::scoped_lock aGuard(maMtxTables);
TablesType::iterator itTab = maTables.find(nTab);
if (itTab == maTables.end())
@@ -93,7 +93,7 @@ ColumnBlockPosition* ColumnBlockPositionSet::getBlockPosition(SCTAB nTab, SCCOL
void ColumnBlockPositionSet::clear()
{
- std::lock_guard aGuard(maMtxTables);
+ std::scoped_lock aGuard(maMtxTables);
maTables.clear();
}
diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx
index 71cfa4eaf4ff..bf495c06c337 100644
--- a/sc/source/core/data/poolhelp.cxx
+++ b/sc/source/core/data/poolhelp.cxx
@@ -91,7 +91,7 @@ std::unique_ptr<SvNumberFormatter> ScPoolHelper::CreateNumberFormatter() const
{
std::unique_ptr<SvNumberFormatter> p;
{
- std::lock_guard aGuard(maMtxCreateNumFormatter);
+ std::scoped_lock aGuard(maMtxCreateNumFormatter);
p.reset(new SvNumberFormatter(comphelper::getProcessComponentContext(), LANGUAGE_SYSTEM));
}
p->SetColorLink( LINK(&m_rSourceDoc, ScDocument, GetUserDefinedColor) );
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 63cbfe5736f0..3dd1b70e20f8 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -115,7 +115,7 @@ OUString ScEditUtil::GetString( const EditTextObject& rEditText, const ScDocumen
return GetMultilineString( rEditText );
static std::mutex aMutex;
- std::lock_guard aGuard( aMutex);
+ std::scoped_lock aGuard( aMutex);
// ScFieldEditEngine is needed to resolve field contents.
if (pDoc)
{
diff --git a/sc/source/core/tool/refreshtimer.cxx b/sc/source/core/tool/refreshtimer.cxx
index 35c8eace9b40..bd1e0447d7a6 100644
--- a/sc/source/core/tool/refreshtimer.cxx
+++ b/sc/source/core/tool/refreshtimer.cxx
@@ -36,7 +36,7 @@ ScRefreshTimerProtector::ScRefreshTimerProtector( std::unique_ptr<ScRefreshTimer
{
m_rpControl->SetAllowRefresh( false );
// wait for any running refresh in another thread to finish
- std::lock_guard aGuard( m_rpControl->GetMutex() );
+ std::scoped_lock aGuard( m_rpControl->GetMutex() );
}
}
@@ -122,7 +122,7 @@ void ScRefreshTimer::Invoke()
if ( ppControl && *ppControl && (*ppControl)->IsRefreshAllowed() )
{
// now we COULD make the call in another thread ...
- std::lock_guard aGuard( (*ppControl)->GetMutex() );
+ std::scoped_lock aGuard( (*ppControl)->GetMutex() );
Timer::Invoke();
// restart from now on, don't execute immediately again if timed out
// a second time during refresh
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index 40470d0bc966..a93043830892 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -398,7 +398,7 @@ void FormulaBuffer::finalizeImport()
FormulaBuffer::SheetItem FormulaBuffer::getSheetItem( SCTAB nTab )
{
- std::lock_guard aGuard(maMtxData);
+ std::scoped_lock aGuard(maMtxData);
SheetItem aItem;