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

Miklos Vajna vmiklos at collabora.co.uk
Thu Apr 2 06:12:02 PDT 2015


 sc/source/ui/view/gridwin4.cxx |    8 +++++++-
 sd/source/ui/view/sdwindow.cxx |    7 ++++++-
 vcl/source/window/paint.cxx    |    9 ---------
 3 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit df79e02bc2eae3dfa8129405b94393dfec1ebd20
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Apr 2 15:10:50 2015 +0200

    vcl tiled rendering: don't do anything with disabled mapmode and mm100 mapunit
    
    Turns out Impress wants an mm100 -> twips conversion in this case, while
    Calc wants a pixel -> twips one, so there isn't anything here that can
    be abstracted in VCL.
    
    Change-Id: Ieb961afa97affbf682e13c0a56585396ae09f552

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e414e10..81c4136 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -987,7 +987,13 @@ void ScGridWindow::LogicInvalidate(const Rectangle* pRectangle)
     else
     {
         Rectangle aRectangle(*pRectangle);
-        if (!IsMapModeEnabled())
+        // When dragging shapes the map mode is disabled.
+        if (IsMapModeEnabled())
+        {
+            if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
+                aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP);
+        }
+        else
             aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_PIXEL, MAP_TWIP);
         sRectangle = aRectangle.toString();
     }
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 1268596..8506ec0 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -1003,7 +1003,12 @@ void Window::LogicInvalidate(const Rectangle* pRectangle)
     if (!pRectangle)
         sRectangle = "EMPTY";
     else
-        sRectangle = pRectangle->toString();
+    {
+        Rectangle aRectangle(*pRectangle);
+        if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
+            aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP);
+        sRectangle = aRectangle.toString();
+    }
     mpViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
 }
 
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index f977378..1384dfe 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -859,13 +859,6 @@ void Window::Invalidate( sal_uInt16 nFlags )
     LogicInvalidate(0);
 }
 
-/// 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);
-}
-
 void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
 {
 
@@ -879,7 +872,6 @@ void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
         vcl::Region aRegion( aRect );
         ImplInvalidate( &aRegion, nFlags );
         Rectangle aLogicRectangle(rRect);
-        lcl_toTwips(*this, aLogicRectangle);
         LogicInvalidate(&aLogicRectangle);
     }
 }
@@ -902,7 +894,6 @@ void Window::Invalidate( const vcl::Region& rRegion, sal_uInt16 nFlags )
         {
             ImplInvalidate( &aRegion, nFlags );
             Rectangle aLogicRectangle = rRegion.GetBoundRect();
-            lcl_toTwips(*this, aLogicRectangle);
             LogicInvalidate(&aLogicRectangle);
         }
     }


More information about the Libreoffice-commits mailing list