summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLászló Németh <laszlo.nemeth@collabora.com>2015-04-27 16:22:11 +0200
committerLászló Németh <laszlo.nemeth@collabora.com>2015-04-27 16:22:11 +0200
commite1fb63bb8ed7a9bd4dbe19be0d0da7245c4a2fb2 (patch)
tree91f4f547e0303376965de95948916957b88b5964
parentInitial XTiledRenderable API (diff)
downloadcore-e1fb63bb8ed7a9bd4dbe19be0d0da7245c4a2fb2.tar.gz
core-e1fb63bb8ed7a9bd4dbe19be0d0da7245c4a2fb2.zip
Use HWND instead of HDC, according to XTiledRenderable
Change-Id: I2959ea8b1213d6dade1c2567365f177bf542e075
-rw-r--r--include/vcl/sysdata.hxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx2
-rw-r--r--vcl/win/source/gdi/salvd.cxx4
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 189ef8cfccf1..23635e33e6dd 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;