summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-16 14:10:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-19 08:58:46 +0200
commitdd590fd04f36553262eefd70e5f08c8b23a38c9d (patch)
tree55014ca0b8299c9f432fe688204c5078c60f9a3c
parent9b0a74a4e0fe0c784da62a730d10e8c75e4c7bad (diff)
loplugin:useuniqueptr in GeoTexSvxMultiHatch
Change-Id: I3d25a50ed7ebf78214c0d358243f7e286503b8f8
-rw-r--r--drawinglayer/source/texture/texture3d.cxx15
-rw-r--r--include/drawinglayer/texture/texture3d.hxx6
2 files changed, 9 insertions, 12 deletions
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index 9b03362d19e9..069759533cd5 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -327,36 +327,33 @@ namespace drawinglayer
const double fAngleA(rHatch.getAngle());
maColor = rHatch.getColor();
mbFillBackground = rHatch.isFillBackground();
- mp0 = new GeoTexSvxHatch(
+ mp0.reset( new GeoTexSvxHatch(
aOutlineRange,
aOutlineRange,
rHatch.getDistance(),
- fAngleA);
+ fAngleA) );
if(attribute::HatchStyle::Double == rHatch.getStyle() || attribute::HatchStyle::Triple == rHatch.getStyle())
{
- mp1 = new GeoTexSvxHatch(
+ mp1.reset( new GeoTexSvxHatch(
aOutlineRange,
aOutlineRange,
rHatch.getDistance(),
- fAngleA + F_PI2);
+ fAngleA + F_PI2) );
}
if(attribute::HatchStyle::Triple == rHatch.getStyle())
{
- mp2 = new GeoTexSvxHatch(
+ mp2.reset( new GeoTexSvxHatch(
aOutlineRange,
aOutlineRange,
rHatch.getDistance(),
- fAngleA + F_PI4);
+ fAngleA + F_PI4) );
}
}
GeoTexSvxMultiHatch::~GeoTexSvxMultiHatch()
{
- delete mp0;
- delete mp1;
- delete mp2;
}
bool GeoTexSvxMultiHatch::impIsOnHatch(const basegfx::B2DPoint& rUV) const
diff --git a/include/drawinglayer/texture/texture3d.hxx b/include/drawinglayer/texture/texture3d.hxx
index 1c197473824a..628edb1ec670 100644
--- a/include/drawinglayer/texture/texture3d.hxx
+++ b/include/drawinglayer/texture/texture3d.hxx
@@ -123,9 +123,9 @@ namespace drawinglayer
{
basegfx::BColor maColor;
double mfLogicPixelSize;
- GeoTexSvxHatch* mp0;
- GeoTexSvxHatch* mp1;
- GeoTexSvxHatch* mp2;
+ std::unique_ptr<GeoTexSvxHatch> mp0;
+ std::unique_ptr<GeoTexSvxHatch> mp1;
+ std::unique_ptr<GeoTexSvxHatch> mp2;
bool mbFillBackground : 1;