summaryrefslogtreecommitdiff
path: root/include/basegfx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-11 14:19:47 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-05 08:17:08 -0500
commit5bc2433dd92ab1d7d83a962e4601db5d77d39cf8 (patch)
tree84501ed350e2d44d54c22ec257bfa77a69609431 /include/basegfx
parent0f455f2309d018906e147269f839f52aa22eaf6a (diff)
new loplugin useuniqueptr
Change-Id: Ic7a8b32887c968d86568e4cfad7ddd1f4da7c73f Reviewed-on: https://gerrit.libreoffice.org/33339 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 98e4013c22c4ce63090a575e698cc2af82925e6b) (cherry picked from commit 051b2fbdad2a4b18f6d4b30134438e11fb9bec64)
Diffstat (limited to 'include/basegfx')
-rw-r--r--include/basegfx/raster/bpixelraster.hxx5
-rw-r--r--include/basegfx/raster/bzpixelraster.hxx5
2 files changed, 4 insertions, 6 deletions
diff --git a/include/basegfx/raster/bpixelraster.hxx b/include/basegfx/raster/bpixelraster.hxx
index f85c0af28310..46ef649b9a7e 100644
--- a/include/basegfx/raster/bpixelraster.hxx
+++ b/include/basegfx/raster/bpixelraster.hxx
@@ -38,13 +38,13 @@ namespace basegfx
sal_uInt32 mnWidth;
sal_uInt32 mnHeight;
sal_uInt32 mnCount;
- BPixel* mpContent;
+ std::unique_ptr<BPixel[]> mpContent;
public:
// reset
void reset()
{
- memset(mpContent, 0, sizeof(BPixel) * mnCount);
+ memset(mpContent.get(), 0, sizeof(BPixel) * mnCount);
}
// constructor/destructor
@@ -59,7 +59,6 @@ namespace basegfx
~BPixelRaster()
{
- delete [] mpContent;
}
// coordinate calcs between X/Y and span
diff --git a/include/basegfx/raster/bzpixelraster.hxx b/include/basegfx/raster/bzpixelraster.hxx
index 722abdee89bb..3e0d51b99d38 100644
--- a/include/basegfx/raster/bzpixelraster.hxx
+++ b/include/basegfx/raster/bzpixelraster.hxx
@@ -30,7 +30,7 @@ namespace basegfx
{
protected:
// additionally, host a ZBuffer
- sal_uInt16* mpZBuffer;
+ std::unique_ptr<sal_uInt16[]> mpZBuffer;
public:
// constructor/destructor
@@ -38,12 +38,11 @@ namespace basegfx
: BPixelRaster(nWidth, nHeight),
mpZBuffer(new sal_uInt16[mnCount])
{
- memset(mpZBuffer, 0, sizeof(sal_uInt16) * mnCount);
+ memset(mpZBuffer.get(), 0, sizeof(sal_uInt16) * mnCount);
}
~BZPixelRaster()
{
- delete [] mpZBuffer;
}
// data access read only