summaryrefslogtreecommitdiff
path: root/sdext/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-04 11:53:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-05 09:29:09 +0200
commitfe0ae0efe894ad2b313a5278f3c5ede03747bf4e (patch)
tree902f47cfcc44a21eda614746ef437c97bd44d08e /sdext/source
parent1fd4927817df1134749ec7b69620c49b0089e00b (diff)
loplugin:useuniqueptr in PngHelper::createPng
Change-Id: I55ec28c88a89eab927a46ec666c3698065b151d2 Reviewed-on: https://gerrit.libreoffice.org/59995 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source')
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
index 44f30c0bab28..4d9e3bb46b61 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
@@ -245,11 +245,11 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
Guchar *p, *pm;
GfxRGB rgb;
GfxGray alpha;
- ImageStream* imgStr =
+ std::unique_ptr<ImageStream> imgStr(
new ImageStream(str,
width,
colorMap->getNumPixelComps(),
- colorMap->getBits());
+ colorMap->getBits()));
imgStr->reset();
// create scan line data buffer
@@ -281,11 +281,11 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
// the other, too. Hence the two passes are imperative !
// initialize mask stream
- ImageStream* imgStrMask =
+ std::unique_ptr<ImageStream> imgStrMask(
new ImageStream(maskStr,
maskWidth,
maskColorMap->getNumPixelComps(),
- maskColorMap->getBits());
+ maskColorMap->getBits()));
imgStrMask->reset();
for( int y = 0; y < maskHeight; ++y )
@@ -302,8 +302,8 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
}
}
- delete imgStr;
- delete imgStrMask;
+ imgStr.reset();
+ imgStrMask.reset();
// begind IDAT chunk for scanline data
size_t nIdx = startChunk( "IDAT", o_rOutputBuf );
@@ -330,11 +330,11 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
// initialize stream
Guchar *p;
GfxRGB rgb;
- ImageStream* imgStr =
+ std::unique_ptr<ImageStream> imgStr(
new ImageStream(str,
width,
colorMap->getNumPixelComps(),
- colorMap->getBits());
+ colorMap->getBits()));
imgStr->reset();
// create scan line data buffer
@@ -366,8 +366,8 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
// the other, too. Hence the two passes are imperative !
// initialize mask stream
- ImageStream* imgStrMask =
- new ImageStream(maskStr, maskWidth, 1, 1);
+ std::unique_ptr<ImageStream> imgStrMask(
+ new ImageStream(maskStr, maskWidth, 1, 1));
imgStrMask->reset();
for( int y = 0; y < maskHeight; ++y )
@@ -386,8 +386,8 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
}
}
- delete imgStr;
- delete imgStrMask;
+ imgStr.reset();
+ imgStrMask.reset();
// begind IDAT chunk for scanline data
size_t nIdx = startChunk( "IDAT", o_rOutputBuf );