BaseMutex->std::mutex in vclcanvas::TextLayout

Change-Id: I66970331312f30f42f16299ce6f38b2a13316e41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147633
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2023-02-24 14:04:33 +02:00
parent c55d7540ef
commit 3470c58be9
2 changed files with 13 additions and 13 deletions

View File

@@ -80,7 +80,6 @@ namespace vclcanvas
CanvasFont::Reference rFont, CanvasFont::Reference rFont,
uno::Reference<rendering::XGraphicDevice> xDevice, uno::Reference<rendering::XGraphicDevice> xDevice,
OutDevProviderSharedPtr xOutDev ) : OutDevProviderSharedPtr xOutDev ) :
TextLayout_Base( m_aMutex ),
maText(std::move( aText )), maText(std::move( aText )),
mpFont(std::move( rFont )), mpFont(std::move( rFont )),
mxDevice(std::move( xDevice )), mxDevice(std::move( xDevice )),
@@ -88,13 +87,16 @@ namespace vclcanvas
mnTextDirection( nDirection ) mnTextDirection( nDirection )
{} {}
void SAL_CALL TextLayout::disposing() void TextLayout::disposing(std::unique_lock<std::mutex>& rGuard)
{ {
SolarMutexGuard aGuard; rGuard.unlock();
{
mpOutDevProvider.reset(); SolarMutexGuard aGuard;
mxDevice.clear(); mpOutDevProvider.reset();
mpFont.clear(); mxDevice.clear();
mpFont.clear();
}
rGuard.lock();
} }
// XTextLayout // XTextLayout

View File

@@ -19,8 +19,7 @@
#pragma once #pragma once
#include <cppuhelper/compbase.hxx> #include <comphelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/rendering/StringContext.hpp> #include <com/sun/star/rendering/StringContext.hpp>
@@ -33,11 +32,10 @@
namespace vclcanvas namespace vclcanvas
{ {
typedef ::cppu::WeakComponentImplHelper< css::rendering::XTextLayout, typedef ::comphelper::WeakComponentImplHelper< css::rendering::XTextLayout,
css::lang::XServiceInfo > TextLayout_Base; css::lang::XServiceInfo > TextLayout_Base;
class TextLayout : public ::cppu::BaseMutex, class TextLayout : public TextLayout_Base
public TextLayout_Base
{ {
public: public:
/// make noncopyable /// make noncopyable
@@ -52,7 +50,7 @@ namespace vclcanvas
OutDevProviderSharedPtr xOutDev ); OutDevProviderSharedPtr xOutDev );
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing() override; virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
// XTextLayout // XTextLayout
virtual css::uno::Sequence< css::uno::Reference< css::rendering::XPolyPolygon2D > > SAL_CALL queryTextShapes( ) override; virtual css::uno::Sequence< css::uno::Reference< css::rendering::XPolyPolygon2D > > SAL_CALL queryTextShapes( ) override;