summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-04-02 09:46:22 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-04-07 09:18:11 +0200
commitcf405bb14c45e4c4fe1be9716f19d40b27605c43 (patch)
tree0a8564112eb0c9df8bf1b46fb57d1ae76f2bda4e
parent428c3a712955c1d4787baa2b4c5727b035d566e4 (diff)
vcl tiled rendering: fix Writer/Impress invalidation rectangle
Both Writer and Impress disable map mode during tiled rendering, i.e. IsMapModeEnabled() always returns false. Nevertheless, using GetMapMode(), it's possible to query what was the map unit before disabling the map mode, which is twips for Writer and mm100 for Impress. If Calc needs anything special here, that's better to be done in ScGridWindow::LogicInvalidate(). Change-Id: I2c10df47d32b80d2cef2b6e6587872fe4126a3f5
-rw-r--r--sc/source/ui/view/gridwin4.cxx7
-rw-r--r--vcl/source/window/paint.cxx10
2 files changed, 8 insertions, 9 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 108f36f93545..c5fe4ea85ae0 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -984,7 +984,12 @@ void ScGridWindow::LogicInvalidate(const Rectangle* pRectangle)
if (!pRectangle)
sRectangle = "EMPTY";
else
- sRectangle = pRectangle->toString();
+ {
+ Rectangle aRectangle(*pRectangle);
+ if (!IsMapModeEnabled())
+ aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_PIXEL, MAP_TWIP);
+ sRectangle = aRectangle.toString();
+ }
pViewData->GetDocument()->GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
}
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index e6192267ae9b..f977378a1ab2 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -862,14 +862,8 @@ void Window::Invalidate( sal_uInt16 nFlags )
/// Converts rRectangle from MM100 to twips based on the map mode of rWindow.
void lcl_toTwips(const Window& rWindow, Rectangle& rRectangle)
{
- // When dragging shapes the map mode is disabled.
- if (rWindow.IsMapModeEnabled())
- {
- if (rWindow.GetMapMode().GetMapUnit() == MAP_100TH_MM)
- rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, MAP_TWIP);
- }
- else
- rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_PIXEL, MAP_TWIP);
+ if (rWindow.GetMapMode().GetMapUnit() == MAP_100TH_MM)
+ rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, MAP_TWIP);
}
void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )