diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-27 09:35:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-27 11:49:05 +0100 |
commit | 6464be15193cd0b54b4c1b8236b99e7971311c83 (patch) | |
tree | 47596c59ae1626c076f27cd90fd9517571900542 | |
parent | e038ef76c1ef205143c853a3666fb56ca831750d (diff) |
use comphelper::WeakComponentImplHelper in UnoPolyPolygon
Change-Id: I82248cfbb0cbdb765fa2f97f53e8990a9e05a28b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127547
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | basegfx/Library_basegfx.mk | 1 | ||||
-rw-r--r-- | basegfx/source/tools/unopolypolygon.cxx | 34 | ||||
-rw-r--r-- | include/basegfx/utils/unopolypolygon.hxx | 8 |
3 files changed, 19 insertions, 24 deletions
diff --git a/basegfx/Library_basegfx.mk b/basegfx/Library_basegfx.mk index 8359969ae80c..2f9830d0dcfd 100644 --- a/basegfx/Library_basegfx.mk +++ b/basegfx/Library_basegfx.mk @@ -16,6 +16,7 @@ $(eval $(call gb_Library_set_precompiled_header,basegfx,basegfx/inc/pch/precompi $(eval $(call gb_Library_use_sdk_api,basegfx)) $(eval $(call gb_Library_use_libraries,basegfx,\ + comphelper \ cppu \ cppuhelper \ sal \ diff --git a/basegfx/source/tools/unopolypolygon.cxx b/basegfx/source/tools/unopolypolygon.cxx index 0d1696783c9f..48b3372d5526 100644 --- a/basegfx/source/tools/unopolypolygon.cxx +++ b/basegfx/source/tools/unopolypolygon.cxx @@ -34,7 +34,6 @@ using namespace ::com::sun::star; namespace basegfx::unotools { UnoPolyPolygon::UnoPolyPolygon( const B2DPolyPolygon& rPolyPoly ) : - UnoPolyPolygonBase( m_aMutex ), maPolyPoly( rPolyPoly ), meFillRule( rendering::FillRule_EVEN_ODD ) { @@ -46,7 +45,7 @@ namespace basegfx::unotools const geometry::RealPoint2D& position, const uno::Reference< rendering::XPolyPolygon2D >& polyPolygon ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); modifying(); // TODO(F1): Correctly fulfill the UNO API @@ -124,14 +123,14 @@ namespace basegfx::unotools sal_Int32 SAL_CALL UnoPolyPolygon::getNumberOfPolygons() { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); return maPolyPoly.count(); } sal_Int32 SAL_CALL UnoPolyPolygon::getNumberOfPolygonPoints( sal_Int32 polygon ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); checkIndex( polygon ); return maPolyPoly.getB2DPolygon(polygon).count(); @@ -139,14 +138,14 @@ namespace basegfx::unotools rendering::FillRule SAL_CALL UnoPolyPolygon::getFillRule() { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); return meFillRule; } void SAL_CALL UnoPolyPolygon::setFillRule( rendering::FillRule fillRule ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); modifying(); meFillRule = fillRule; @@ -155,7 +154,7 @@ namespace basegfx::unotools sal_Bool SAL_CALL UnoPolyPolygon::isClosed( sal_Int32 index ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); checkIndex( index ); return maPolyPoly.getB2DPolygon(index).isClosed(); @@ -165,7 +164,7 @@ namespace basegfx::unotools sal_Int32 index, sal_Bool closedState ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); modifying(); if( index == -1 ) @@ -192,8 +191,6 @@ namespace basegfx::unotools sal_Int32 nPointIndex, sal_Int32 nNumberOfPoints ) { - osl::MutexGuard const guard( m_aMutex ); - return unotools::pointSequenceSequenceFromB2DPolyPolygon( getSubsetPolyPolygon( nPolygonIndex, nNumberOfPolygons, @@ -205,7 +202,7 @@ namespace basegfx::unotools const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points, sal_Int32 nPolygonIndex ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); modifying(); const B2DPolyPolygon& rNewPolyPoly( @@ -227,7 +224,7 @@ namespace basegfx::unotools sal_Int32 nPolygonIndex, sal_Int32 nPointIndex ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); checkIndex( nPolygonIndex ); const B2DPolygon& rPoly( maPolyPoly.getB2DPolygon( nPolygonIndex ) ); @@ -243,7 +240,7 @@ namespace basegfx::unotools sal_Int32 nPolygonIndex, sal_Int32 nPointIndex ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); checkIndex( nPolygonIndex ); modifying(); @@ -263,7 +260,6 @@ namespace basegfx::unotools sal_Int32 nPointIndex, sal_Int32 nNumberOfPoints ) { - osl::MutexGuard const guard( m_aMutex ); return unotools::bezierSequenceSequenceFromB2DPolyPolygon( getSubsetPolyPolygon( nPolygonIndex, nNumberOfPolygons, @@ -275,7 +271,7 @@ namespace basegfx::unotools const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points, sal_Int32 nPolygonIndex ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); modifying(); const B2DPolyPolygon& rNewPolyPoly( unotools::polyPolygonFromBezier2DSequenceSequence( points ) ); @@ -295,7 +291,7 @@ namespace basegfx::unotools geometry::RealBezierSegment2D SAL_CALL UnoPolyPolygon::getBezierSegment( sal_Int32 nPolygonIndex, sal_Int32 nPointIndex ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); checkIndex( nPolygonIndex ); const B2DPolygon& rPoly( maPolyPoly.getB2DPolygon( nPolygonIndex ) ); @@ -320,7 +316,7 @@ namespace basegfx::unotools sal_Int32 nPolygonIndex, sal_Int32 nPointIndex ) { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); checkIndex( nPolygonIndex ); modifying(); @@ -347,7 +343,7 @@ namespace basegfx::unotools sal_Int32 nPointIndex, sal_Int32 nNumberOfPoints ) const { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); checkIndex( nPolygonIndex ); const sal_Int32 nPolyCount( maPolyPoly.count() ); @@ -441,7 +437,7 @@ namespace basegfx::unotools B2DPolyPolygon UnoPolyPolygon::getPolyPolygon() const { - osl::MutexGuard const guard( m_aMutex ); + std::unique_lock const guard( m_aMutex ); // detach result from us B2DPolyPolygon aRet( maPolyPoly ); diff --git a/include/basegfx/utils/unopolypolygon.hxx b/include/basegfx/utils/unopolypolygon.hxx index b320998ac1a2..42da5921c7df 100644 --- a/include/basegfx/utils/unopolypolygon.hxx +++ b/include/basegfx/utils/unopolypolygon.hxx @@ -19,8 +19,7 @@ #pragma once -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/rendering/FillRule.hpp> @@ -31,14 +30,13 @@ namespace basegfx::unotools { - typedef cppu::WeakComponentImplHelper< + typedef comphelper::WeakComponentImplHelper< css::rendering::XLinePolyPolygon2D, css::rendering::XBezierPolyPolygon2D, css::lang::XServiceInfo > UnoPolyPolygonBase; class BASEGFX_DLLPUBLIC UnoPolyPolygon - : private cppu::BaseMutex - , public UnoPolyPolygonBase + : public UnoPolyPolygonBase { public: explicit UnoPolyPolygon( const B2DPolyPolygon& ); |