summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-11-02 02:39:36 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-11-10 07:58:44 +0100
commite62559bb3e5a6f9b25028585dfa041172e645a0f (patch)
tree9a4b6b61c30a187468d3f0dfa6c949e01ee1e70d /vcl/win
parentc8431b7fe226f6681adba7dc03f88235264081bb (diff)
a little bit more sanity
Change-Id: I080984c5faaa8cf349ba37ffdb116b6d8d016552
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/source/gdi/salgdi.cxx8
-rw-r--r--vcl/win/source/gdi/salprn.cxx3
-rw-r--r--vcl/win/source/gdi/salvd.cxx3
-rw-r--r--vcl/win/source/window/salframe.cxx10
4 files changed, 13 insertions, 11 deletions
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index c9f9cf4be19c..af16d907e391 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -554,12 +554,13 @@ void ImplClearHDCCache( SalData* pData )
}
}
-WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen):
+WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd):
mpImpl(new WinSalGraphicsImpl(*this)),
mhLocalDC(0),
mbPrinter(eType == WinSalGraphics::PRINTER),
mbVirDev(eType == WinSalGraphics::VIRTUAL_DEVICE),
mbWindow(eType == WinSalGraphics::WINDOW),
+ mhWnd(hWnd),
mbScreen(bScreen),
mfCurrentFontScale(1.0),
mhRegion(0),
@@ -638,6 +639,11 @@ HWND WinSalGraphics::gethWnd()
return mhWnd;
}
+void WinSalGraphics::setHWND(HWND hWnd)
+{
+ mhWnd = hWnd;
+}
+
void WinSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
{
rDPIX = GetDeviceCaps( getHDC(), LOGPIXELSX );
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index ffcc7d0ebcde..b992554aafe0 100644
--- a/vcl/win/source/gdi/salprn.cxx
+++ b/vcl/win/source/gdi/salprn.cxx
@@ -1045,10 +1045,9 @@ static HDC ImplCreateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetup
static WinSalGraphics* ImplCreateSalPrnGraphics( HDC hDC )
{
- WinSalGraphics* pGraphics = new WinSalGraphics(WinSalGraphics::PRINTER, false);
+ WinSalGraphics* pGraphics = new WinSalGraphics(WinSalGraphics::PRINTER, false, 0);
pGraphics->SetLayout( 0 );
pGraphics->setHDC(hDC);
- pGraphics->mhWnd = 0;
ImplSalInitGraphics( pGraphics );
return pGraphics;
}
diff --git a/vcl/win/source/gdi/salvd.cxx b/vcl/win/source/gdi/salvd.cxx
index a05de8d8c960..820f12f6f125 100644
--- a/vcl/win/source/gdi/salvd.cxx
+++ b/vcl/win/source/gdi/salvd.cxx
@@ -104,10 +104,9 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
{
WinSalVirtualDevice* pVDev = new WinSalVirtualDevice;
SalData* pSalData = GetSalData();
- WinSalGraphics* pVirGraphics = new WinSalGraphics(WinSalGraphics::VIRTUAL_DEVICE, pGraphics->isScreen());
+ WinSalGraphics* pVirGraphics = new WinSalGraphics(WinSalGraphics::VIRTUAL_DEVICE, pGraphics->isScreen(), 0);
pVirGraphics->SetLayout( 0 ); // by default no! mirroring for VirtualDevices, can be enabled with EnableRTL()
pVirGraphics->setHDC(hDC);
- pVirGraphics->mhWnd = 0;
if ( pSalData->mhDitherPal && pVirGraphics->isScreen() )
{
pVirGraphics->mhDefPal = SelectPalette( hDC, pSalData->mhDitherPal, TRUE );
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 309dd5ad31db..dde2845b7449 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -983,9 +983,8 @@ SalGraphics* WinSalFrame::AcquireGraphics()
if ( !mpGraphics2 )
{
- mpGraphics2 = new WinSalGraphics(WinSalGraphics::WINDOW, true);
+ mpGraphics2 = new WinSalGraphics(WinSalGraphics::WINDOW, true, mhWnd);
mpGraphics2->setHDC(0);
- mpGraphics2->mhWnd = mhWnd;
}
HDC hDC = (HDC)(sal_IntPtr)SendMessageW( pSalData->mpFirstInstance->mhComWnd,
@@ -1015,9 +1014,8 @@ SalGraphics* WinSalFrame::AcquireGraphics()
HDC hDC = GetDC( mhWnd );
if ( hDC )
{
- mpGraphics = new WinSalGraphics(WinSalGraphics::WINDOW, true);
+ mpGraphics = new WinSalGraphics(WinSalGraphics::WINDOW, true, mhWnd);
mpGraphics->setHDC(hDC);
- mpGraphics->mhWnd = mhWnd;
if ( pSalData->mhDitherPal )
{
mpGraphics->mhDefPal = SelectPalette( hDC, pSalData->mhDitherPal, TRUE );
@@ -1512,7 +1510,7 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, bool bAs
{
if( pThis->mpGraphics2 )
{
- pThis->mpGraphics2->mhWnd = hWnd;
+ pThis->mpGraphics2->setHWND(hWnd);
if( bNeedCacheDC )
{
@@ -1550,7 +1548,7 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, bool bAs
if( pThis->mpGraphics )
{
// re-create DC
- pThis->mpGraphics->mhWnd = hWnd;
+ pThis->mpGraphics->setHWND(hWnd);
pThis->mpGraphics->setHDC( GetDC( hWnd ) );
if ( GetSalData()->mhDitherPal )
{