summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-04 12:12:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-05 09:29:28 +0200
commit93e5da84a40be70857833903e3ebdea395c06596 (patch)
tree02189f70c5821b965533d2bc1e242f1580b7e16e
parentfe0ae0efe894ad2b313a5278f3c5ede03747bf4e (diff)
loplugin:useuniqueptr in Printer
Change-Id: I5326c96f86f6805246837524e75504c1c5db99b5 Reviewed-on: https://gerrit.libreoffice.org/59997 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--vcl/source/gdi/print.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index c767a0a65c02..8d876acaa38f 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -743,8 +743,8 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
// do painting
const long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight();
long nX, nY; //, nWorkX, nWorkY, nWorkWidth, nWorkHeight;
- long* pMapX = new long[ nSrcWidth + 1 ];
- long* pMapY = new long[ nSrcHeight + 1 ];
+ std::unique_ptr<long[]> pMapX( new long[ nSrcWidth + 1 ] );
+ std::unique_ptr<long[]> pMapY( new long[ nSrcHeight + 1 ] );
GDIMetaFile* pOldMetaFile = mpMetaFile;
const bool bOldMap = mbMap;
@@ -779,11 +779,8 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
}
Pop();
- delete[] pMapX;
- delete[] pMapY;
mbMap = bOldMap;
mpMetaFile = pOldMetaFile;
-
}
SalPrinterQueueInfo* Printer::ImplGetQueueInfo( const OUString& rPrinterName,