summaryrefslogtreecommitdiff
path: root/vcl/source/window/window.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-01-18 18:26:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-19 07:26:42 +0100
commita6106c9319e04f4966f30d357eedfe23bef4a30c (patch)
tree1f6177dcd857b46f77059c507dfb24012d5a9106 /vcl/source/window/window.cxx
parentf1762fb4d9dce6897a36e425a0c95a1dd28c28af (diff)
add OutputDevice::GetOutputRectPixel method
to simplify some and make an upcoming change less invasive Change-Id: I699b2be8fa35b2b72271eda4a0885f89a47b348a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109563 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/window.cxx')
-rw-r--r--vcl/source/window/window.cxx24
1 files changed, 7 insertions, 17 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 755a17127634..789e31e4034f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1541,8 +1541,7 @@ void Window::ImplPosSizeWindow( tools::Long nX, tools::Long nY,
if ( bCopyBits && !pOverlapRegion )
{
pOverlapRegion.reset( new vcl::Region() );
- ImplCalcOverlapRegion( tools::Rectangle( Point( mnOutOffX, mnOutOffY ),
- Size( mnOutWidth, mnOutHeight ) ),
+ ImplCalcOverlapRegion( GetOutputRectPixel(),
*pOverlapRegion, false, true );
}
mpWindowImpl->mnX = nX;
@@ -1559,8 +1558,7 @@ void Window::ImplPosSizeWindow( tools::Long nX, tools::Long nY,
if ( bCopyBits && !pOverlapRegion )
{
pOverlapRegion.reset( new vcl::Region() );
- ImplCalcOverlapRegion( tools::Rectangle( Point( mnOutOffX, mnOutOffY ),
- Size( mnOutWidth, mnOutHeight ) ),
+ ImplCalcOverlapRegion( GetOutputRectPixel(),
*pOverlapRegion, false, true );
}
mpWindowImpl->mnY = nY;
@@ -1645,9 +1643,7 @@ void Window::ImplPosSizeWindow( tools::Long nX, tools::Long nY,
bParentPaint = mpWindowImpl->mpParent->IsPaintEnabled();
if ( bCopyBits && bParentPaint && !HasPaintEvent() )
{
- Point aPoint( mnOutOffX, mnOutOffY );
- vcl::Region aRegion( tools::Rectangle( aPoint,
- Size( mnOutWidth, mnOutHeight ) ) );
+ vcl::Region aRegion( GetOutputRectPixel() );
if ( mpWindowImpl->mbWinRegion )
aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
ImplClipBoundaries( aRegion, false, true );
@@ -1697,9 +1693,7 @@ void Window::ImplPosSizeWindow( tools::Long nX, tools::Long nY,
}
else
{
- Point aPoint( mnOutOffX, mnOutOffY );
- vcl::Region aRegion( tools::Rectangle( aPoint,
- Size( mnOutWidth, mnOutHeight ) ) );
+ vcl::Region aRegion( GetOutputRectPixel() );
aRegion.Exclude( *pOldRegion );
if ( mpWindowImpl->mbWinRegion )
aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
@@ -2942,8 +2936,7 @@ tools::Rectangle Window::ImplGetWindowExtentsRelative(const vcl::Window *pRelati
void Window::Scroll( tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags )
{
- ImplScroll( tools::Rectangle( Point( mnOutOffX, mnOutOffY ),
- Size( mnOutWidth, mnOutHeight ) ),
+ ImplScroll( GetOutputRectPixel(),
nHorzScroll, nVertScroll, nFlags & ~ScrollFlags::Clip );
}
@@ -2952,7 +2945,7 @@ void Window::Scroll( tools::Long nHorzScroll, tools::Long nVertScroll,
{
OutputDevice *pOutDev = GetOutDev();
tools::Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect );
- aRect.Intersection( tools::Rectangle( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ) );
+ aRect.Intersection( GetOutputRectPixel() );
if ( !aRect.IsEmpty() )
ImplScroll( aRect, nHorzScroll, nVertScroll, nFlags );
}
@@ -2960,10 +2953,7 @@ void Window::Scroll( tools::Long nHorzScroll, tools::Long nVertScroll,
void Window::Flush()
{
if (mpWindowImpl)
- {
- const tools::Rectangle aWinRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) );
- mpWindowImpl->mpFrame->Flush( aWinRect );
- }
+ mpWindowImpl->mpFrame->Flush( GetOutputRectPixel() );
}
void Window::SetUpdateMode( bool bUpdate )