diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2017-02-12 10:39:34 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-12 17:06:29 +0000 |
commit | b82a9f34eca092f13396177d61145093be84e600 (patch) | |
tree | 1d07219153fc17373d48535e4931f326913f2c4d /vcl/win/gdi | |
parent | ff2927095ed64851f4418cc8daa534e2581da537 (diff) |
VCL: Simplify WinSalInstance::CreateVirtualDevice
Change-Id: I26e9823faa53fdbb0ae468f03e40b0a4e5313b49
Reviewed-on: https://gerrit.libreoffice.org/34170
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win/gdi')
-rw-r--r-- | vcl/win/gdi/salvd.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/vcl/win/gdi/salvd.cxx b/vcl/win/gdi/salvd.cxx index 65d8600f6934..afd4fc7a7399 100644 --- a/vcl/win/gdi/salvd.cxx +++ b/vcl/win/gdi/salvd.cxx @@ -90,14 +90,12 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics, HDC hDC = nullptr; HBITMAP hBmp = nullptr; - bool bOk = FALSE; if( pData ) { hDC = (pData->hDC) ? pData->hDC : GetDC(pData->hWnd); hBmp = nullptr; - bOk = (hDC != nullptr); - if (bOk) + if (hDC) { nDX = GetDeviceCaps( hDC, HORZRES ); nDY = GetDeviceCaps( hDC, VERTRES ); @@ -119,11 +117,9 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics, // #124826# continue even if hBmp could not be created // if we would return a failure in this case, the process // would terminate which is not required - - bOk = (hDC != nullptr); } - if ( bOk ) + if (hDC) { WinSalVirtualDevice* pVDev = new WinSalVirtualDevice(hDC, hBmp, nBitCount, (pData != nullptr && pData->hDC != nullptr ), nDX, nDY); SalData* pSalData = GetSalData(); @@ -143,8 +139,6 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics, } else { - if ( hDC && !pData ) - DeleteDC( hDC ); if ( hBmp ) DeleteBitmap( hBmp ); return nullptr; |