[Libreoffice-commits] core.git: Branch 'feature/xtiledrenderable' - include/vcl sw/source vcl/win

László Németh laszlo.nemeth at collabora.com
Mon Apr 27 07:25:31 PDT 2015


 include/vcl/sysdata.hxx           |    2 ++
 sw/source/uibase/uno/unotxdoc.cxx |    2 +-
 vcl/win/source/gdi/salvd.cxx      |    4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit e1fb63bb8ed7a9bd4dbe19be0d0da7245c4a2fb2
Author: László Németh <laszlo.nemeth at collabora.com>
Date:   Mon Apr 27 16:22:11 2015 +0200

    Use HWND instead of HDC, according to XTiledRenderable
    
    Change-Id: I2959ea8b1213d6dade1c2567365f177bf542e075

diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx
index a4fad69..a525f77 100644
--- a/include/vcl/sysdata.hxx
+++ b/include/vcl/sysdata.hxx
@@ -137,6 +137,7 @@ struct SystemGraphicsData
     unsigned long   nSize;          // size in bytes of this structure
 #if defined( WNT )
     HDC             hDC;            // handle to a device context
+    HWND            hWnd;           // optional handle to a window
 #elif defined( MACOSX )
     CGContextRef    rCGContext;     // CoreGraphics graphic context
 #elif defined( ANDROID )
@@ -156,6 +157,7 @@ struct SystemGraphicsData
         : nSize( sizeof( SystemGraphicsData ) )
 #if defined( WNT )
         , hDC( 0 )
+        , hWnd( 0 )
 #elif defined( MACOSX )
         , rCGContext( NULL )
 #elif defined( ANDROID )
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 189ef8c..23635e3 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3289,7 +3289,7 @@ void SAL_CALL SwXTextDocument::paintTile( const ::css::uno::Any& Parent, ::sal_I
     #if defined WNT
     sal_Int64 nWindowHandle;
     Parent >>= nWindowHandle;
-    aData.hDC = (HDC) nWindowHandle;
+    aData.hWnd = (HWND) nWindowHandle;
     VirtualDevice aDevice(&aData, Size(1, 1), (sal_uInt16)32);
     paintTile( aDevice, nOutputWidth, nOutputHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight );
     #else
diff --git a/vcl/win/source/gdi/salvd.cxx b/vcl/win/source/gdi/salvd.cxx
index c76432d..340e160 100644
--- a/vcl/win/source/gdi/salvd.cxx
+++ b/vcl/win/source/gdi/salvd.cxx
@@ -79,7 +79,7 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
 
     if( pData )
     {
-        hDC = pData->hDC;
+        hDC = (pData->hDC) ? pData->hDC : GetDC(pData->hWnd);
         hBmp = NULL;
         bOk = (hDC != NULL);
         if (bOk)
@@ -137,7 +137,7 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
         pVDev->mpGraphics   = pVirGraphics;
         pVDev->mnBitCount   = nBitCount;
         pVDev->mbGraphics   = FALSE;
-        pVDev->mbForeignDC  = (pData != NULL);
+        pVDev->mbForeignDC  = (pData != NULL && pData->hDC != NULL );
 
         // insert VirDev in VirDevList
         pVDev->mpNext = pSalData->mpFirstVD;


More information about the Libreoffice-commits mailing list