diff options
author | László Németh <laszlo.nemeth@collabora.com> | 2015-04-27 16:22:11 +0200 |
---|---|---|
committer | László Németh <laszlo.nemeth@collabora.com> | 2015-05-07 17:47:23 +0200 |
commit | a1bfad005cfb0b54744746da20a81f9bb8908ae0 (patch) | |
tree | 25004ee69d95a5a1e31c060c8b8625ac91503315 | |
parent | 96a6128b9259e62ae0b2872a3157bb1bb32d2a6d (diff) |
XTiledRenderable: use HWND instead of HDC
Cherry-picked from e1fb63bb8ed7a9bd4dbe19be0d0da7245c4a2fb2
Change-Id: I2959ea8b1213d6dade1c2567365f177bf542e075
-rw-r--r-- | include/vcl/sysdata.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 2 | ||||
-rw-r--r-- | vcl/win/source/gdi/salvd.cxx | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx index a4fad69ae414..a525f77fbbc8 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 01d78fe6b670..86689a0ecc08 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 c76432d52da1..340e1609c2dc 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; |