sc/source/ui/view/gridwin4.cxx | 7 ++++++- vcl/source/window/paint.cxx | 10 ++-------- 2 files changed, 8 insertions(+), 9 deletions(-)
New commits: commit e1aa279188b72f6677b01c0fc2f89852bfa0c283 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Apr 2 09:46:22 2015 +0200 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 diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 108f36f..c5fe4ea 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 e619226..f977378 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 ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits