summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-03-20 15:48:04 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-23 09:19:07 +0100
commit35cf00e20ad5826f715f5d5bbc48d486228774ca (patch)
treef991ea468d892a5a7e1ae87c6818eacd1a55cfe9 /vcl
parent97ea96fed5a189e59982f97f57119938448296e2 (diff)
OutputDevice::LogicInvalidate: take a Rectangle
At the end this gets exported in the LOK API as a rectangle anyway, so better to convert the vcl::Regions into a Rectangle, and not the other way around. Change-Id: I81fede6e30af112d17bb74328801915d90474863
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/paint.cxx25
1 files changed, 9 insertions, 16 deletions
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 7180d79a2af0..480f3897e2bd 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -859,18 +859,11 @@ 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)
+/// Converts rRectangle from MM100 to twips based on the map mode of rWindow.
+void lcl_toTwips(const Window& rWindow, Rectangle& rRectangle)
{
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;
- }
+ rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, MAP_TWIP);
}
void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
@@ -885,9 +878,9 @@ 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);
+ Rectangle aLogicRectangle(rRect);
+ lcl_toTwips(*this, aLogicRectangle);
+ LogicInvalidate(&aLogicRectangle);
}
}
@@ -908,9 +901,9 @@ void Window::Invalidate( const vcl::Region& rRegion, sal_uInt16 nFlags )
if ( !aRegion.IsEmpty() )
{
ImplInvalidate( &aRegion, nFlags );
- vcl::Region aLogicRegion(rRegion);
- lcl_toTwips(*this, aLogicRegion);
- LogicInvalidate(&aLogicRegion);
+ Rectangle aLogicRectangle = rRegion.GetBoundRect();
+ lcl_toTwips(*this, aLogicRectangle);
+ LogicInvalidate(&aLogicRectangle);
}
}
}