summaryrefslogtreecommitdiff
path: root/canvas/source/tools/parametricpolypolygon.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'canvas/source/tools/parametricpolypolygon.cxx')
-rw-r--r--canvas/source/tools/parametricpolypolygon.cxx37
1 files changed, 14 insertions, 23 deletions
diff --git a/canvas/source/tools/parametricpolypolygon.cxx b/canvas/source/tools/parametricpolypolygon.cxx
index c75d84348690..ca42d7fe36f7 100644
--- a/canvas/source/tools/parametricpolypolygon.cxx
+++ b/canvas/source/tools/parametricpolypolygon.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/rendering/XGraphicDevice.hpp>
#include <parametricpolypolygon.hxx>
+#include <utility>
using namespace ::com::sun::star;
@@ -44,18 +45,14 @@ namespace canvas
std::u16string_view rServiceName,
const uno::Sequence< uno::Any >& rArgs )
{
- uno::Sequence< uno::Sequence< double > > colorSequence(2);
- uno::Sequence< double > colorStops(2);
double fAspectRatio=1.0;
// defaults
- uno::Sequence< rendering::RGBColor > rgbColors(1);
- rgbColors[0] = rendering::RGBColor(0,0,0);
- colorSequence[0] = rDevice->getDeviceColorSpace()->convertFromRGB(rgbColors);
- rgbColors[0] = rendering::RGBColor(1,1,1);
- colorSequence[1] = rDevice->getDeviceColorSpace()->convertFromRGB(rgbColors);
- colorStops[0] = 0;
- colorStops[1] = 1;
+ uno::Sequence< uno::Sequence< double > > colorSequence{
+ rDevice->getDeviceColorSpace()->convertFromRGB({ rendering::RGBColor(0,0,0) }),
+ rDevice->getDeviceColorSpace()->convertFromRGB({ rendering::RGBColor(1,1,1) })
+ };
+ uno::Sequence< double > colorStops{ 0, 1 };
// extract args
for( const uno::Any& rArg : rArgs )
@@ -151,10 +148,8 @@ namespace canvas
colors, stops, fAspectRatio );
}
- void SAL_CALL ParametricPolyPolygon::disposing()
+ void ParametricPolyPolygon::disposing(std::unique_lock<std::mutex>&)
{
- ::osl::MutexGuard aGuard( m_aMutex );
-
mxDevice.clear();
}
@@ -178,7 +173,7 @@ namespace canvas
uno::Reference< rendering::XColorSpace > SAL_CALL ParametricPolyPolygon::getColorSpace()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
return mxDevice.is() ? mxDevice->getDeviceColorSpace() : uno::Reference< rendering::XColorSpace >();
}
@@ -186,7 +181,7 @@ namespace canvas
OUString SAL_CALL ParametricPolyPolygon::getImplementationName( )
{
- return "Canvas::ParametricPolyPolygon";
+ return u"Canvas::ParametricPolyPolygon"_ustr;
}
sal_Bool SAL_CALL ParametricPolyPolygon::supportsService( const OUString& ServiceName )
@@ -196,21 +191,20 @@ namespace canvas
uno::Sequence< OUString > SAL_CALL ParametricPolyPolygon::getSupportedServiceNames( )
{
- return { "com.sun.star.rendering.ParametricPolyPolygon" };
+ return { u"com.sun.star.rendering.ParametricPolyPolygon"_ustr };
}
ParametricPolyPolygon::~ParametricPolyPolygon()
{
}
- ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice,
+ ParametricPolyPolygon::ParametricPolyPolygon( uno::Reference< rendering::XGraphicDevice > xDevice,
const ::basegfx::B2DPolygon& rGradientPoly,
GradientType eType,
const uno::Sequence< uno::Sequence< double > >& rColors,
const uno::Sequence< double >& rStops,
double nAspectRatio ) :
- ParametricPolyPolygon_Base( m_aMutex ),
- mxDevice( rDevice ),
+ mxDevice(std::move( xDevice )),
maValues( rGradientPoly,
rColors,
rStops,
@@ -219,12 +213,11 @@ namespace canvas
{
}
- ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice,
+ ParametricPolyPolygon::ParametricPolyPolygon( uno::Reference< rendering::XGraphicDevice > xDevice,
GradientType eType,
const uno::Sequence< uno::Sequence< double > >& rColors,
const uno::Sequence< double >& rStops ) :
- ParametricPolyPolygon_Base( m_aMutex ),
- mxDevice( rDevice ),
+ mxDevice(std::move( xDevice )),
maValues( ::basegfx::B2DPolygon(),
rColors,
rStops,
@@ -235,8 +228,6 @@ namespace canvas
ParametricPolyPolygon::Values ParametricPolyPolygon::getValues() const
{
- ::osl::MutexGuard aGuard( m_aMutex );
-
return maValues;
}