[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - vcl/source

Henry Castro hcastro at collabora.com
Wed Apr 1 15:14:19 PDT 2015


 vcl/source/window/paint.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 93916bb3167802e7abb4fe0a1bcb5c1366cb476e
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Apr 1 17:59:46 2015 -0400

    sc tiled editing: Invalidate graphic selection.
    
    When dragging shapes the MapMode is disabled, so the coordinates are wrong values
    converted to twip unit.
    
    Change-Id: Idf1e40963cf124fd20dbdf8633487bc71786c6cf

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index f977378..e619226 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -862,8 +862,14 @@ 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)
 {
-    if (rWindow.GetMapMode().GetMapUnit() == MAP_100TH_MM)
-        rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, MAP_TWIP);
+    // 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);
 }
 
 void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )


More information about the Libreoffice-commits mailing list