diff options
author | Noel Grandin <noelgrandin@collabora.co.uk> | 2023-04-12 13:40:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-12 15:47:03 +0200 |
commit | 9cfa99594cc21ad42f3428c4e2c521dd87511fc2 (patch) | |
tree | fced54888ccabe4ea676788fa44e13a327f6ee39 /vcl | |
parent | a925476352b3cb32f6384e7b0fb07e323bb6e64f (diff) |
use more unique_ptr in SalData
Change-Id: Ib6e5131bff38b55b2dbf0805b63ca3554c5ee349
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150278
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/win/saldata.hxx | 6 | ||||
-rw-r--r-- | vcl/win/gdi/salgdi.cxx | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index 3145688e24be..2d20903d6157 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -86,9 +86,9 @@ public: HGLOBAL mhDitherDIB; // dither memory handle BYTE* mpDitherDIB; // dither memory BYTE* mpDitherDIBData; // beginning of DIB data - tools::Long* mpDitherDiff; // Dither mapping table - BYTE* mpDitherLow; // Dither mapping table - BYTE* mpDitherHigh; // Dither mapping table + std::unique_ptr<tools::Long[]> mpDitherDiff; // Dither mapping table + std::unique_ptr<BYTE[]> mpDitherLow; // Dither mapping table + std::unique_ptr<BYTE[]> mpDitherHigh; // Dither mapping table HHOOK mhSalObjMsgHook; // hook to get interesting msg for SalObject HWND mhWantLeaveMsg; // window handle, that want a MOUSELEAVE message AutoTimer* mpMouseLeaveTimer; // Timer for MouseLeave Test diff --git a/vcl/win/gdi/salgdi.cxx b/vcl/win/gdi/salgdi.cxx index 630933192687..8a38a684ca35 100644 --- a/vcl/win/gdi/salgdi.cxx +++ b/vcl/win/gdi/salgdi.cxx @@ -180,9 +180,9 @@ void ImplInitSalGDI() pSalData->mhDitherDIB = GlobalAlloc( GMEM_FIXED, sizeof( BITMAPINFOHEADER ) + 192 ); pSalData->mpDitherDIB = static_cast<BYTE*>(GlobalLock( pSalData->mhDitherDIB )); - pSalData->mpDitherDiff = new tools::Long[ 256 ]; - pSalData->mpDitherLow = new BYTE[ 256 ]; - pSalData->mpDitherHigh = new BYTE[ 256 ]; + pSalData->mpDitherDiff.reset(new tools::Long[ 256 ]); + pSalData->mpDitherLow.reset(new BYTE[ 256 ]); + pSalData->mpDitherHigh.reset(new BYTE[ 256 ]); pSalData->mpDitherDIBData = pSalData->mpDitherDIB + sizeof( BITMAPINFOHEADER ); memset( pSalData->mpDitherDIB, 0, sizeof( BITMAPINFOHEADER ) ); @@ -254,9 +254,9 @@ void ImplInitSalGDI() pSalData->mhDitherDIB = GlobalAlloc( GMEM_FIXED, nSize ); pSalData->mpDitherDIB = static_cast<BYTE*>(GlobalLock( pSalData->mhDitherDIB )); - pSalData->mpDitherDiff = new tools::Long[ 256 ]; - pSalData->mpDitherLow = new BYTE[ 256 ]; - pSalData->mpDitherHigh = new BYTE[ 256 ]; + pSalData->mpDitherDiff.reset(new tools::Long[ 256 ]); + pSalData->mpDitherLow.reset(new BYTE[ 256 ]); + pSalData->mpDitherHigh.reset(new BYTE[ 256 ]); pSalData->mpDitherDIBData = pSalData->mpDitherDIB + sizeof( BITMAPINFOHEADER ) + ( 256 * sizeof( short ) ); memset( pSalData->mpDitherDIB, 0, sizeof( BITMAPINFOHEADER ) ); @@ -333,9 +333,9 @@ void ImplFreeSalGDI() GlobalUnlock( pSalData->mhDitherDIB ); GlobalFree( pSalData->mhDitherDIB ); pSalData->mhDitherDIB = nullptr; - delete[] pSalData->mpDitherDiff; - delete[] pSalData->mpDitherLow; - delete[] pSalData->mpDitherHigh; + pSalData->mpDitherDiff.reset(); + pSalData->mpDitherLow.reset(); + pSalData->mpDitherHigh.reset(); } DeleteSysColorList(); |