canvas/source/opengl/ogl_textlayout.cxx |   15 +++++++--------
 canvas/source/opengl/ogl_textlayout.hxx |   10 ++++------
 2 files changed, 11 insertions(+), 14 deletions(-)

New commits:
commit b7996c451d001613e1b1511ca7a0b23e79a94581
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Feb 28 11:48:46 2023 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Feb 28 14:26:27 2023 +0000

    BaseMutex->std::mutex in oglcanvas::TextLayout
    
    Change-Id: I76b95eb8444c057d94f5653769e23047c019b139
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147964
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/canvas/source/opengl/ogl_textlayout.cxx 
b/canvas/source/opengl/ogl_textlayout.cxx
index f3b04152f1d7..9c023fe9f409 100644
--- a/canvas/source/opengl/ogl_textlayout.cxx
+++ b/canvas/source/opengl/ogl_textlayout.cxx
@@ -23,14 +23,13 @@ namespace oglcanvas
                             sal_Int8                      nDirection,
                             sal_Int64                     /*nRandomSeed*/,
                             CanvasFont::ImplRef           rFont ) :
-        TextLayoutBaseT( m_aMutex ),
         maText(std::move( aText )),
         mpFont(std::move( rFont )),
         mnTextDirection( nDirection )
     {
     }
 
-    void SAL_CALL TextLayout::disposing()
+    void TextLayout::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
     {
         mpFont.clear();
     }
@@ -56,14 +55,14 @@ namespace oglcanvas
 
     uno::Sequence< double > SAL_CALL TextLayout::queryLogicalAdvancements(  )
     {
-        ::osl::MutexGuard aGuard( m_aMutex );
+        std::unique_lock aGuard( m_aMutex );
 
         return maLogicalAdvancements;
     }
 
     void SAL_CALL TextLayout::applyLogicalAdvancements( const uno::Sequence< 
double >& aAdvancements )
     {
-        ::osl::MutexGuard aGuard( m_aMutex );
+        std::unique_lock aGuard( m_aMutex );
 
         if( aAdvancements.getLength() != maText.Length )
         {
@@ -76,7 +75,7 @@ namespace oglcanvas
 
     geometry::RealRectangle2D SAL_CALL TextLayout::queryTextBounds(  )
     {
-        ::osl::MutexGuard aGuard( m_aMutex );
+        std::unique_lock aGuard( m_aMutex );
 
         ENSURE_OR_THROW( mpFont,
                          "TextLayout::queryTextBounds(): invalid font" );
@@ -156,21 +155,21 @@ namespace oglcanvas
 
     sal_Int8 SAL_CALL TextLayout::getMainTextDirection(  )
     {
-        ::osl::MutexGuard aGuard( m_aMutex );
+        std::unique_lock aGuard( m_aMutex );
 
         return mnTextDirection;
     }
 
     uno::Reference< rendering::XCanvasFont > SAL_CALL TextLayout::getFont(  )
     {
-        ::osl::MutexGuard aGuard( m_aMutex );
+        std::unique_lock aGuard( m_aMutex );
 
         return mpFont;
     }
 
     rendering::StringContext SAL_CALL TextLayout::getText(  )
     {
-        ::osl::MutexGuard aGuard( m_aMutex );
+        std::unique_lock aGuard( m_aMutex );
 
         return maText;
     }
diff --git a/canvas/source/opengl/ogl_textlayout.hxx 
b/canvas/source/opengl/ogl_textlayout.hxx
index ce7b1958993e..1d6467d96bc1 100644
--- a/canvas/source/opengl/ogl_textlayout.hxx
+++ b/canvas/source/opengl/ogl_textlayout.hxx
@@ -9,8 +9,7 @@
 
 #pragma once
 
-#include <cppuhelper/compbase.hxx>
-#include <cppuhelper/basemutex.hxx>
+#include <comphelper/compbase.hxx>
 
 #include <com/sun/star/rendering/XTextLayout.hpp>
 
@@ -21,10 +20,9 @@
 
 namespace oglcanvas
 {
-    typedef ::cppu::WeakComponentImplHelper< css::rendering::XTextLayout > 
TextLayoutBaseT;
+    typedef ::comphelper::WeakComponentImplHelper< css::rendering::XTextLayout 
> TextLayoutBaseT;
 
-    class TextLayout : public ::cppu::BaseMutex,
-                       public TextLayoutBaseT
+    class TextLayout : public TextLayoutBaseT
     {
     public:
         TextLayout( css::rendering::StringContext               aText,
@@ -37,7 +35,7 @@ namespace oglcanvas
         const TextLayout& operator=(const TextLayout&) = delete;
 
         /// Dispose all internal references
-        virtual void SAL_CALL disposing() override;
+        virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
 
         // XTextLayout
         virtual css::uno::Sequence< css::uno::Reference< 
css::rendering::XPolyPolygon2D > > SAL_CALL queryTextShapes(  ) override;

Reply via email to