summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-11 14:19:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-23 06:59:17 +0000
commit98e4013c22c4ce63090a575e698cc2af82925e6b (patch)
tree571d99c39420e929cd43e0365354da1aced03e68 /include
parent2d1cecf02b34d855c8d64e3271bffbcbf9bf4138 (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>
Diffstat (limited to 'include')
-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