summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-08-03 21:26:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-04 10:06:06 +0200
commit330ba10a212f007babb2f3d27de88197936291dd (patch)
treea086822301f34d843e3a9220d4aa522349e60e32 /toolkit
parent48c5ba19e4f4a1ad5a88b5e6f0816c080e1253ec (diff)
osl::Mutex->std::mutex in VCLXRegion
Change-Id: I8110539975721f515707f42f29dda94346805f93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119952 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/inc/awt/vclxregion.hxx6
-rw-r--r--toolkit/source/awt/vclxregion.cxx24
2 files changed, 14 insertions, 16 deletions
diff --git a/toolkit/inc/awt/vclxregion.hxx b/toolkit/inc/awt/vclxregion.hxx
index 4f59416ae77d..4ba3211cc2c7 100644
--- a/toolkit/inc/awt/vclxregion.hxx
+++ b/toolkit/inc/awt/vclxregion.hxx
@@ -25,7 +25,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/implbase.hxx>
-#include <osl/mutex.hxx>
+#include <mutex>
#include <vcl/region.hxx>
@@ -36,11 +36,9 @@ class VCLXRegion final : public cppu::WeakImplHelper<
css::awt::XRegion,
css::lang::XUnoTunnel>
{
- ::osl::Mutex maMutex;
+ std::mutex maMutex;
vcl::Region maRegion;
- ::osl::Mutex& GetMutex() { return maMutex; }
-
public:
VCLXRegion();
virtual ~VCLXRegion() override;
diff --git a/toolkit/source/awt/vclxregion.cxx b/toolkit/source/awt/vclxregion.cxx
index f3356d300bfd..a3e6268d5991 100644
--- a/toolkit/source/awt/vclxregion.cxx
+++ b/toolkit/source/awt/vclxregion.cxx
@@ -38,56 +38,56 @@ UNO3_GETIMPLEMENTATION_IMPL( VCLXRegion );
css::awt::Rectangle VCLXRegion::getBounds()
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
return AWTRectangle( maRegion.GetBoundRect() );
}
void VCLXRegion::clear()
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
maRegion.SetEmpty();
}
void VCLXRegion::move( sal_Int32 nHorzMove, sal_Int32 nVertMove )
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
maRegion.Move( nHorzMove, nVertMove );
}
void VCLXRegion::unionRectangle( const css::awt::Rectangle& rRect )
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
maRegion.Union( VCLRectangle( rRect ) );
}
void VCLXRegion::intersectRectangle( const css::awt::Rectangle& rRect )
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
maRegion.Intersect( VCLRectangle( rRect ) );
}
void VCLXRegion::excludeRectangle( const css::awt::Rectangle& rRect )
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
maRegion.Exclude( VCLRectangle( rRect ) );
}
void VCLXRegion::xOrRectangle( const css::awt::Rectangle& rRect )
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
maRegion.XOr( VCLRectangle( rRect ) );
}
void VCLXRegion::unionRegion( const css::uno::Reference< css::awt::XRegion >& rxRegion )
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
if ( rxRegion.is() )
maRegion.Union( VCLUnoHelper::GetRegion( rxRegion ) );
@@ -95,7 +95,7 @@ void VCLXRegion::unionRegion( const css::uno::Reference< css::awt::XRegion >& rx
void VCLXRegion::intersectRegion( const css::uno::Reference< css::awt::XRegion >& rxRegion )
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
if ( rxRegion.is() )
maRegion.Intersect( VCLUnoHelper::GetRegion( rxRegion ) );
@@ -103,7 +103,7 @@ void VCLXRegion::intersectRegion( const css::uno::Reference< css::awt::XRegion >
void VCLXRegion::excludeRegion( const css::uno::Reference< css::awt::XRegion >& rxRegion )
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
if ( rxRegion.is() )
maRegion.Exclude( VCLUnoHelper::GetRegion( rxRegion ) );
@@ -111,7 +111,7 @@ void VCLXRegion::excludeRegion( const css::uno::Reference< css::awt::XRegion >&
void VCLXRegion::xOrRegion( const css::uno::Reference< css::awt::XRegion >& rxRegion )
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
if ( rxRegion.is() )
maRegion.XOr( VCLUnoHelper::GetRegion( rxRegion ) );
@@ -119,7 +119,7 @@ void VCLXRegion::xOrRegion( const css::uno::Reference< css::awt::XRegion >& rxRe
css::uno::Sequence< css::awt::Rectangle > VCLXRegion::getRectangles()
{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ std::scoped_lock aGuard( maMutex );
RectangleVector aRectangles;
maRegion.GetRegionRectangles(aRectangles);