[Libreoffice-commits] core.git: vcl/win

Arnaud Versini arnaud.versini at gmail.com
Sun Feb 12 17:06:55 UTC 2017


 vcl/win/gdi/salvd.cxx |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

New commits:
commit b82a9f34eca092f13396177d61145093be84e600
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sun Feb 12 10:39:34 2017 +0100

    VCL: Simplify WinSalInstance::CreateVirtualDevice
    
    Change-Id: I26e9823faa53fdbb0ae468f03e40b0a4e5313b49
    Reviewed-on: https://gerrit.libreoffice.org/34170
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/win/gdi/salvd.cxx b/vcl/win/gdi/salvd.cxx
index 65d8600..afd4fc7 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;


More information about the Libreoffice-commits mailing list