diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-20 12:37:26 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-23 09:19:06 +0100 |
commit | f9c9f57e6901ce6a55a153962d0852324d9cadcf (patch) | |
tree | 3faea933f2fa974671a7f1141b70bd4fc7127882 /vcl | |
parent | 355f1199fdd552cfd4fa167b345f37649ae76d80 (diff) |
OutputDevice::LogicInvalidate: clean up sc/sd duplication
Writer is not affected, as there the map mode is disabled and everything
is in twips internally.
Change-Id: I3b5289f82e89be5943a0b14a5167b33132cf78d0
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/paint.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 4d47decb9a74..7180d79a2af0 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -859,6 +859,20 @@ void Window::Invalidate( sal_uInt16 nFlags ) LogicInvalidate(0); } +/// Converts rRegion from MM100 to twips based on the map mode of rWindow. +void lcl_toTwips(Window& rWindow, vcl::Region& rRegion) +{ + if (rWindow.IsMapModeEnabled() && rWindow.GetMapMode().GetMapUnit() == MAP_100TH_MM) + { + Rectangle aRectangle = rRegion.GetBoundRect(); + aRectangle.Left() = convertMm100ToTwip(aRectangle.Left()); + aRectangle.Top() = convertMm100ToTwip(aRectangle.Top()); + aRectangle.Right() = convertMm100ToTwip(aRectangle.Right()); + aRectangle.Bottom() = convertMm100ToTwip(aRectangle.Bottom()); + rRegion = aRectangle; + } +} + void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags ) { @@ -872,6 +886,7 @@ void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags ) vcl::Region aRegion( aRect ); ImplInvalidate( &aRegion, nFlags ); vcl::Region aLogicRegion(rRect); + lcl_toTwips(*this, aLogicRegion); LogicInvalidate(&aLogicRegion); } } @@ -894,6 +909,7 @@ void Window::Invalidate( const vcl::Region& rRegion, sal_uInt16 nFlags ) { ImplInvalidate( &aRegion, nFlags ); vcl::Region aLogicRegion(rRegion); + lcl_toTwips(*this, aLogicRegion); LogicInvalidate(&aLogicRegion); } } |