summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-02-03 21:48:31 +1100
committerCaolán McNamara <caolanm@redhat.com>2014-02-05 14:38:05 +0000
commite45c729da21c6923032b64c543136efe066b756a (patch)
tree2862f39563f3d06e956613a857f1c6365d8f356c
parent7e122c54f588f56d45e7c09a3327fecb0f8dbef8 (diff)
fdo#74424 Use Window::GetOutDev() to access ImplLogicToDevicePixel()
Part of the decoupling of Window from OutputDevice. We now get the Window's OutputDevice instance and manipulate this. Do not rely on the inherited function. Conflicts: vcl/source/window/window.cxx vcl/source/window/window2.cxx Change-Id: I5e5241ed9eb586bc31ae9411cd7eef460aa707c3 Reviewed-on: https://gerrit.libreoffice.org/7800 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/window/window.cxx16
-rw-r--r--vcl/source/window/window2.cxx19
-rw-r--r--vcl/source/window/winproc.cxx8
3 files changed, 25 insertions, 18 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 6aa8d7b43388..a5ebc0ce04e6 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2983,6 +2983,8 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( !mpWindowImpl->mpFirstChild )
bScrollChildren = sal_False;
+ OutputDevice *pOutDev = GetOutDev();
+
// --- RTL --- check if this window requires special action
sal_Bool bReMirror = ( ImplIsAntiparallel() );
@@ -2991,7 +2993,6 @@ void Window::ImplScroll( const Rectangle& rRect,
{
// --- RTL --- make sure the invalidate region of this window is
// computed in the same coordinate space as the one from the overlap windows
- const OutputDevice *pOutDev = GetOutDev();
pOutDev->ImplReMirror( aRectMirror );
}
@@ -3055,9 +3056,6 @@ void Window::ImplScroll( const Rectangle& rRect,
SalGraphics* pGraphics = ImplGetFrameGraphics();
if ( pGraphics )
{
-
- OutputDevice *pOutDev = GetOutDev();
-
if( bReMirror )
{
// --- RTL --- frame coordinates require re-mirroring
@@ -4221,7 +4219,8 @@ void Window::ImplNewInputContext()
aNewContext.mpFont = NULL;
if (!rFontName.isEmpty())
{
- Size aSize = pFocusWin->ImplLogicToDevicePixel( rFont.GetSize() );
+ OutputDevice *pFocusWinOutDev = pFocusWin->GetOutDev();
+ Size aSize = pFocusWinOutDev->ImplLogicToDevicePixel( rFont.GetSize() );
if ( !aSize.Height() )
{
// only set default sizes if the font height in logical
@@ -7328,7 +7327,8 @@ void Window::Scroll( long nHorzScroll, long nVertScroll,
const Rectangle& rRect, sal_uInt16 nFlags )
{
- Rectangle aRect = ImplLogicToDevicePixel( rRect );
+ OutputDevice *pOutDev = GetOutDev();
+ Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect );
aRect.Intersection( Rectangle( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ) );
if ( !aRect.IsEmpty() )
ImplScroll( aRect, nHorzScroll, nVertScroll, nFlags );
@@ -7353,7 +7353,9 @@ void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
if ( !IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight )
return;
- Rectangle aRect = ImplLogicToDevicePixel( rRect );
+
+ OutputDevice *pOutDev = GetOutDev();
+ Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect );
if ( !aRect.IsEmpty() )
{
Region aRegion( aRect );
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 2689957b0b49..0af25502f68c 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -378,7 +378,8 @@ void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
if ( !IsDeviceOutputNecessary() )
return;
- Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
+ OutputDevice *pOutDev = GetOutDev();
+ Rectangle aRect( pOutDev->ImplLogicToDevicePixel( rRect ) );
if ( aRect.IsEmpty() )
return;
@@ -387,7 +388,7 @@ void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
// we need a graphics
if ( !mpGraphics )
{
- if ( !ImplGetGraphics() )
+ if ( !pOutDev->ImplGetGraphics() )
return;
}
@@ -417,7 +418,8 @@ void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags )
if ( nPoints < 2 )
return;
- Polygon aPoly( ImplLogicToDevicePixel( rPoly ) );
+ OutputDevice *pOutDev = GetOutDev();
+ Polygon aPoly( pOutDev->ImplLogicToDevicePixel( rPoly ) );
// we need a graphics
if ( !mpGraphics )
@@ -486,7 +488,8 @@ void Window::HideTracking()
void Window::InvertTracking( const Rectangle& rRect, sal_uInt16 nFlags )
{
- Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
+ OutputDevice *pOutDev = GetOutDev();
+ Rectangle aRect( pOutDev->ImplLogicToDevicePixel( rRect ) );
if ( aRect.IsEmpty() )
return;
@@ -523,7 +526,6 @@ void Window::InvertTracking( const Rectangle& rRect, sal_uInt16 nFlags )
Point aPoint( mnOutOffX, mnOutOffY );
Region aRegion( Rectangle( aPoint,
Size( mnOutWidth, mnOutHeight ) ) );
- OutputDevice *pOutDev = GetOutDev();
ImplClipBoundaries( aRegion, sal_False, sal_False );
pOutDev->ImplSelectClipRegion( aRegion, pGraphics );
}
@@ -555,7 +557,9 @@ void Window::InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags )
if ( nPoints < 2 )
return;
- Polygon aPoly( ImplLogicToDevicePixel( rPoly ) );
+ OutputDevice *pOutDev = GetOutDev();
+
+ Polygon aPoly( pOutDev->ImplLogicToDevicePixel( rPoly ) );
SalGraphics* pGraphics;
@@ -567,7 +571,7 @@ void Window::InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags )
// we need a graphics
if ( !mpGraphics )
{
- if ( !ImplGetGraphics() )
+ if ( !pOutDev->ImplGetGraphics() )
return;
}
@@ -588,7 +592,6 @@ void Window::InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags )
Point aPoint( mnOutOffX, mnOutOffY );
Region aRegion( Rectangle( aPoint,
Size( mnOutWidth, mnOutHeight ) ) );
- OutputDevice *pOutDev = GetOutDev();
ImplClipBoundaries( aRegion, sal_False, sal_False );
pOutDev->ImplSelectClipRegion( aRegion, pGraphics );
}
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 7d6806177442..a1a625f8fd9f 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1322,16 +1322,17 @@ static void ImplHandleExtTextInputPos( Window* pWindow,
if ( pChild )
{
+ const OutputDevice *pChildOutDev = pChild->GetOutDev();
ImplCallCommand( pChild, COMMAND_CURSORPOS );
const Rectangle* pRect = pChild->GetCursorRect();
if ( pRect )
- rRect = pChild->ImplLogicToDevicePixel( *pRect );
+ rRect = pChildOutDev->ImplLogicToDevicePixel( *pRect );
else
{
Cursor* pCursor = pChild->GetCursor();
if ( pCursor )
{
- Point aPos = pChild->ImplLogicToDevicePixel( pCursor->GetPos() );
+ Point aPos = pChildOutDev->ImplLogicToDevicePixel( pCursor->GetPos() );
Size aSize = pChild->LogicToPixel( pCursor->GetSize() );
if ( !aSize.Width() )
aSize.Width() = pChild->GetSettings().GetStyleSettings().GetCursorSize();
@@ -2318,8 +2319,9 @@ static void ImplHandleSalQueryCharPosition( Window *pWindow,
ImplWinData* pWinData = pChild->ImplGetWinData();
if ( pWinData->mpCompositionCharRects && pEvt->mnCharPos < static_cast<sal_uLong>( pWinData->mnCompositionCharRects ) )
{
+ OutputDevice *pChildOutDev = pChild->GetOutDev();
const Rectangle& aRect = pWinData->mpCompositionCharRects[ pEvt->mnCharPos ];
- Rectangle aDeviceRect = pChild->ImplLogicToDevicePixel( aRect );
+ Rectangle aDeviceRect = pChildOutDev->ImplLogicToDevicePixel( aRect );
Point aAbsScreenPos = pChild->OutputToAbsoluteScreenPixel( pChild->ScreenToOutputPixel(aDeviceRect.TopLeft()) );
pEvt->mnCursorBoundX = aAbsScreenPos.X();
pEvt->mnCursorBoundY = aAbsScreenPos.Y();