[Libreoffice-commits] core.git: toolkit/inc toolkit/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 4 08:06:41 UTC 2021


 toolkit/inc/awt/vclxregion.hxx    |    6 ++----
 toolkit/source/awt/vclxregion.cxx |   24 ++++++++++++------------
 2 files changed, 14 insertions(+), 16 deletions(-)

New commits:
commit 330ba10a212f007babb2f3d27de88197936291dd
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Tue Aug 3 21:26:45 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Aug 4 10:06:06 2021 +0200

    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 at collabora.co.uk>

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);


More information about the Libreoffice-commits mailing list