summaryrefslogtreecommitdiff
path: root/basegfx/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-27 09:35:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-27 11:49:05 +0100
commit6464be15193cd0b54b4c1b8236b99e7971311c83 (patch)
tree47596c59ae1626c076f27cd90fd9517571900542 /basegfx/source
parente038ef76c1ef205143c853a3666fb56ca831750d (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>
Diffstat (limited to 'basegfx/source')
-rw-r--r--basegfx/source/tools/unopolypolygon.cxx34
1 files changed, 15 insertions, 19 deletions
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 );