From 5d0b961b1962474fd5c5be9a6a064114a710bc1b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 19 Oct 2018 17:34:39 +0100 Subject: use std::unique_ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8645d1d0776f7b7f2cd6e6d18f387210c6e126d9 Reviewed-on: https://gerrit.libreoffice.org/62068 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/win/gdi/gdiimpl.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'vcl') 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 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; } } -- cgit