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

Miklos Vajna vmiklos at collabora.co.uk
Fri Mar 20 07:49:51 PDT 2015


 include/vcl/outdev.hxx            |    6 +++---
 sc/source/ui/inc/gridwin.hxx      |    2 +-
 sc/source/ui/view/gridwin4.cxx    |    6 +++---
 sd/source/ui/inc/Window.hxx       |    2 +-
 sd/source/ui/view/sdwindow.cxx    |    6 +++---
 sw/source/uibase/docvw/edtwin.cxx |    6 +++---
 sw/source/uibase/inc/edtwin.hxx   |    8 ++------
 vcl/source/window/paint.cxx       |   25 +++++++++----------------
 8 files changed, 25 insertions(+), 36 deletions(-)

New commits:
commit 70b175269786299e69d59030325c44dd3cfcccb8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Mar 20 15:48:04 2015 +0100

    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

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index ec1063b..a5bce4c 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1731,11 +1731,11 @@ public:
 
 protected:
     /**
-     * Notification about some region of the output device got invalidated.
+     * Notification about some rectangle of the output device got invalidated.
      *
-     * @param pRegion If 0, that means the whole area, otherwise the area in logic coordinates.
+     * @param pRectangle If 0, that means the whole area, otherwise the area in logic coordinates.
      */
-    virtual void LogicInvalidate(const vcl::Region* /*pRegion*/) { }
+    virtual void LogicInvalidate(const Rectangle* /*pRectangle*/) { }
 
 private:
 
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index ac158bf..36a7e5c 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -322,7 +322,7 @@ public:
                                long nTileWidth, long nTileHeight );
 
     /// @see OutputDevice::LogicInvalidate().
-    void LogicInvalidate(const ::vcl::Region* pRegion) SAL_OVERRIDE;
+    void LogicInvalidate(const Rectangle* pRectangle) SAL_OVERRIDE;
 
     /// Same as MouseButtonDown(), but coordinates are in logic unit.
     void LogicMouseButtonDown(const MouseEvent& rMouseEvent);
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index cf72fc3..cdef76d 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -978,13 +978,13 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
     pSdrPageView->RemovePaintWindowFromPageView(aTemporaryPaintWindow);
 }
 
-void ScGridWindow::LogicInvalidate(const ::vcl::Region* pRegion)
+void ScGridWindow::LogicInvalidate(const Rectangle* pRectangle)
 {
     OString sRectangle;
-    if (!pRegion)
+    if (!pRectangle)
         sRectangle = "EMPTY";
     else
-        sRectangle = pRegion->GetBoundRect().toString();
+        sRectangle = pRectangle->toString();
 
     pViewData->GetDocument()->GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
 }
diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx
index 9055037..be2bb1a 100644
--- a/sd/source/ui/inc/Window.hxx
+++ b/sd/source/ui/inc/Window.hxx
@@ -193,7 +193,7 @@ protected:
     OUString GetSurroundingText() const SAL_OVERRIDE;
     Selection GetSurroundingTextSelection() const SAL_OVERRIDE;
     /// @see OutputDevice::LogicInvalidate().
-    void LogicInvalidate(const ::vcl::Region* pRegion) SAL_OVERRIDE;
+    void LogicInvalidate(const Rectangle* pRectangle) SAL_OVERRIDE;
 };
 
 } // end of namespace sd
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 727eca9..20e3086 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -990,13 +990,13 @@ Selection Window::GetSurroundingTextSelection() const
     }
 }
 
-void Window::LogicInvalidate(const ::vcl::Region* pRegion)
+void Window::LogicInvalidate(const Rectangle* pRectangle)
 {
     OString sRectangle;
-    if (!pRegion)
+    if (!pRectangle)
         sRectangle = "EMPTY";
     else
-        sRectangle = pRegion->GetBoundRect().toString();
+        sRectangle = pRectangle->toString();
     mpViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
 }
 
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index f6b4ffe..a82ad90 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -6249,13 +6249,13 @@ Selection SwEditWin::GetSurroundingTextSelection() const
     }
 }
 
-void SwEditWin::LogicInvalidate(const vcl::Region* pRegion)
+void SwEditWin::LogicInvalidate(const Rectangle* pRectangle)
 {
     OString sRectangle;
-    if (!pRegion)
+    if (!pRectangle)
         sRectangle = "EMPTY";
     else
-        sRectangle = pRegion->GetBoundRect().toString();
+        sRectangle = pRectangle->toString();
     m_rView.GetWrtShell().libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
 }
 
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx
index 3aeee19..7c212bb 100644
--- a/sw/source/uibase/inc/edtwin.hxx
+++ b/sw/source/uibase/inc/edtwin.hxx
@@ -296,12 +296,8 @@ public:
 
     SwEditWin(vcl::Window *pParent, SwView &);
     virtual ~SwEditWin();
-    /**
-     * Notification about some region of the output device got invalidated.
-     *
-     * @param pRegion If 0, that means the whole area, otherwise the area in logic coordinates.
-     */
-    void LogicInvalidate(const vcl::Region* pRegion) SAL_OVERRIDE;
+    /// @see OutputDevice::LogicInvalidate().
+    void LogicInvalidate(const Rectangle* pRectangle) SAL_OVERRIDE;
     /// Same as MouseButtonDown(), but coordinates are in logic unit.
     void LogicMouseButtonDown(const MouseEvent& rMouseEvent);
     /// Same as MouseButtonUp(), but coordinates are in logic unit.
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 7180d79..480f389 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);
         }
     }
 }


More information about the Libreoffice-commits mailing list