summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-19 17:34:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-20 19:55:51 +0200
commit5d0b961b1962474fd5c5be9a6a064114a710bc1b (patch)
treeb6ab99f3de2d92c0b69f2a52586f3e4767430cbb
parent2efbeea3f2625f62e08e78789de25ca5783d5e5d (diff)
use std::unique_ptr
Change-Id: I8645d1d0776f7b7f2cd6e6d18f387210c6e126d9 Reviewed-on: https://gerrit.libreoffice.org/62068 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/win/gdi/gdiimpl.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 3962c4d4a52d..1ba590cc803e 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -579,14 +579,14 @@ void ImplDrawBitmap( HDC hDC, const SalTwoRect& rPosAry, const WinSalBitmap& rSa
{
HGLOBAL hDrawDIB;
HBITMAP hDrawDDB = rSalBitmap.ImplGethDDB();
- WinSalBitmap* pTmpSalBmp = nullptr;
+ std::unique_ptr<WinSalBitmap> xTmpSalBmp;
bool bPrintDDB = ( bPrinter && hDrawDDB );
if( bPrintDDB )
{
- pTmpSalBmp = new WinSalBitmap;
- pTmpSalBmp->Create( rSalBitmap, rSalBitmap.GetBitCount() );
- hDrawDIB = pTmpSalBmp->ImplGethDIB();
+ xTmpSalBmp.reset(new WinSalBitmap);
+ xTmpSalBmp->Create( rSalBitmap, rSalBitmap.GetBitCount() );
+ hDrawDIB = xTmpSalBmp->ImplGethDIB();
}
else
hDrawDIB = rSalBitmap.ImplGethDIB();
@@ -670,9 +670,6 @@ void ImplDrawBitmap( HDC hDC, const SalTwoRect& rPosAry, const WinSalBitmap& rSa
ImplReleaseCachedDC( CACHED_HDC_DRAW );
}
-
- if( bPrintDDB )
- delete pTmpSalBmp;
}
}