summaryrefslogtreecommitdiff
path: root/svx/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 /svx/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 'svx/source')
-rw-r--r--svx/source/accessibility/AccessibleTextHelper.cxx6
-rw-r--r--svx/source/form/ParseContext.cxx4
-rw-r--r--svx/source/form/fmtools.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrprimitivetools.cxx2
-rw-r--r--svx/source/xml/xmleohlp.cxx6
5 files changed, 10 insertions, 10 deletions
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index f1753226aa71..2b84f8f32404 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -109,7 +109,7 @@ namespace accessibility
void SetOffset( const Point& );
Point GetOffset() const
{
- std::lock_guard aGuard( maMutex ); Point aPoint( maOffset );
+ std::scoped_lock aGuard( maMutex ); Point aPoint( maOffset );
return aPoint;
}
@@ -732,7 +732,7 @@ namespace accessibility
{
// guard against non-atomic access to maOffset data structure
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
maOffset = rPoint;
}
@@ -1383,7 +1383,7 @@ namespace accessibility
// -- object locked --
AccessibleEventObject aEvent;
{
- std::lock_guard aGuard(maMutex);
+ std::scoped_lock aGuard(maMutex);
DBG_ASSERT(mxFrontEnd.is(), "AccessibleTextHelper::FireEvent: no event source set");
diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx
index e5e76229907d..63634179142e 100644
--- a/svx/source/form/ParseContext.cxx
+++ b/svx/source/form/ParseContext.cxx
@@ -173,7 +173,7 @@ namespace
OParseContextClient::OParseContextClient()
{
- std::lock_guard aGuard( getSafetyMutex() );
+ std::scoped_lock aGuard( getSafetyMutex() );
++s_nCounter;
if ( 1 == s_nCounter )
{ // first instance
@@ -184,7 +184,7 @@ OParseContextClient::OParseContextClient()
OParseContextClient::~OParseContextClient()
{
- std::lock_guard aGuard( getSafetyMutex() );
+ std::scoped_lock aGuard( getSafetyMutex() );
--s_nCounter;
if ( 0 == s_nCounter )
delete getSharedContext(nullptr,true);
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index e8e0a5e1a328..9263651ff2ef 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -235,7 +235,7 @@ FmXDisposeListener::~FmXDisposeListener()
void FmXDisposeListener::setAdapter(FmXDisposeMultiplexer* pAdapter)
{
- std::lock_guard aGuard(m_aMutex);
+ std::scoped_lock aGuard(m_aMutex);
m_pAdapter = pAdapter;
}
diff --git a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
index 3612326f2307..6376fa796086 100644
--- a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
+++ b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
@@ -33,7 +33,7 @@ namespace drawinglayer::primitive2d
static basegfx::BColor aBColor;
static std::mutex aMutex;
- std::lock_guard aGuard(aMutex);
+ std::scoped_lock aGuard(aMutex);
if(!aRetVal.get() || rBColor != aBColor)
{
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx
index c58c60527d21..ad9445e4c7f0 100644
--- a/svx/source/xml/xmleohlp.cxx
+++ b/svx/source/xml/xmleohlp.cxx
@@ -101,19 +101,19 @@ SvStream *OutputStorageWrapper_Impl::GetStream()
void SAL_CALL OutputStorageWrapper_Impl::writeBytes(
const Sequence< sal_Int8 >& aData)
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
xOut->writeBytes( aData );
}
void SAL_CALL OutputStorageWrapper_Impl::flush()
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
xOut->flush();
}
void SAL_CALL OutputStorageWrapper_Impl::closeOutput()
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
xOut->closeOutput();
bStreamClosed = true;
}