[Libreoffice-commits] core.git: include/svx sd/source svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri May 17 16:11:32 UTC 2019


 include/svx/graphctl.hxx             |    3 ++-
 include/svx/svdpntv.hxx              |    5 ++---
 sd/source/ui/inc/ClientView.hxx      |    4 ++--
 sd/source/ui/view/clview.cxx         |    4 ++--
 svx/source/dialog/graphctl.cxx       |   15 +++++++++++++--
 svx/source/svdraw/sdrpagewindow.cxx  |    2 +-
 svx/source/svdraw/sdrpaintwindow.cxx |    6 ------
 svx/source/svdraw/svdpagv.cxx        |    2 +-
 svx/source/svdraw/svdpntv.cxx        |   10 ++++++----
 9 files changed, 29 insertions(+), 22 deletions(-)

New commits:
commit 810e1a86b0f87086f972f0b1190130ce3ec088b2
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 16 13:57:07 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri May 17 18:10:30 2019 +0200

    there's already a way to customize the invalidation
    
    Change-Id: I486494de730b8665e56cfc664b62830fb0b8b8ee
    Reviewed-on: https://gerrit.libreoffice.org/72415
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx
index b4044d2b072b..d4fe23b3abca 100644
--- a/include/svx/graphctl.hxx
+++ b/include/svx/graphctl.hxx
@@ -264,7 +264,8 @@ public:
     // override these so we can get the occasions SdrPaintView would call Window::Invalidate on its vcl::Window
     // if it had one, and route to WidgetController::Invalidate instead
     virtual rtl::Reference<sdr::overlay::OverlayManager> CreateOverlayManager(OutputDevice& rDevice) const override;
-    virtual void InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const override;
+    virtual void InvalidateOneWin(OutputDevice& rWin) override;
+    virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect) override;
 };
 
 #endif // INCLUDED_SVX_GRAPHCTL_HXX
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 7fe1a838b8d3..ce62413bc7c5 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -238,7 +238,6 @@ public:
     SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const;
     // Replacement for GetWin(0), may return 0L (!)
     OutputDevice* GetFirstOutputDevice() const;
-    virtual void InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const;
 
 private:
     SVX_DLLPRIVATE void ImpClearVars();
@@ -432,8 +431,8 @@ public:
 
     /// If the View should not call Invalidate() on the windows, override
     /// the following 2 methods and do something else.
-    virtual void InvalidateOneWin(vcl::Window& rWin);
-    virtual void InvalidateOneWin(vcl::Window& rWin, const tools::Rectangle& rRect);
+    virtual void InvalidateOneWin(OutputDevice& rWin);
+    virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect);
 
     void SetActiveLayer(const OUString& rName) { maActualLayer=rName; }
     const OUString&  GetActiveLayer() const { return maActualLayer; }
diff --git a/sd/source/ui/inc/ClientView.hxx b/sd/source/ui/inc/ClientView.hxx
index a7bb20b51bf2..a616a6252bce 100644
--- a/sd/source/ui/inc/ClientView.hxx
+++ b/sd/source/ui/inc/ClientView.hxx
@@ -38,8 +38,8 @@ public:
 
     /* if the view should not do a Invalidate() on the windows, you have to
        override the following two methods and do something different */
-    virtual void InvalidateOneWin(vcl::Window& rWin) override;
-    virtual void InvalidateOneWin(vcl::Window& rWin, const ::tools::Rectangle& rRect) override;
+    virtual void InvalidateOneWin(OutputDevice& rWin) override;
+    virtual void InvalidateOneWin(OutputDevice& rWin, const ::tools::Rectangle& rRect) override;
 };
 
 } // end of namespace sd
diff --git a/sd/source/ui/view/clview.cxx b/sd/source/ui/view/clview.cxx
index 29905c83909f..a73bd292314f 100644
--- a/sd/source/ui/view/clview.cxx
+++ b/sd/source/ui/view/clview.cxx
@@ -48,7 +48,7 @@ ClientView::~ClientView()
  * to be overridden and properly handled.
  */
 
-void ClientView::InvalidateOneWin(vcl::Window& rWin)
+void ClientView::InvalidateOneWin(OutputDevice& rWin)
 {
     vcl::Region aRegion;
     CompleteRedraw(&rWin, aRegion);
@@ -59,7 +59,7 @@ void ClientView::InvalidateOneWin(vcl::Window& rWin)
  * to be overridden and properly handled.
  */
 
-void ClientView::InvalidateOneWin(vcl::Window& rWin, const ::tools::Rectangle& rRect)
+void ClientView::InvalidateOneWin(OutputDevice& rWin, const ::tools::Rectangle& rRect)
 {
     CompleteRedraw(&rWin, vcl::Region(rRect));
 }
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index d77a7c6e6069..470912a649c5 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -1494,7 +1494,18 @@ rtl::Reference<sdr::overlay::OverlayManager> SvxGraphCtrlView::CreateOverlayMana
     return SdrView::CreateOverlayManager(rDevice);
 }
 
-void SvxGraphCtrlView::InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const
+void SvxGraphCtrlView::InvalidateOneWin(OutputDevice& rDevice)
+{
+    assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
+    if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
+    {
+        rGraphCtrl.Invalidate();
+        return;
+    }
+    SdrView::InvalidateOneWin(rDevice);
+}
+
+void SvxGraphCtrlView::InvalidateOneWin(OutputDevice& rDevice, const tools::Rectangle& rArea)
 {
     assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
     if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
@@ -1502,7 +1513,7 @@ void SvxGraphCtrlView::InvalidateWindow(const tools::Rectangle& rArea, OutputDev
         rGraphCtrl.Invalidate(rArea);
         return;
     }
-    SdrView::InvalidateWindow(rArea, rDevice);
+    SdrView::InvalidateOneWin(rDevice, rArea);
 }
 
 Point SvxGraphCtrl::GetPositionInDialog() const
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index 126caea8cdf1..b85ab66a9e12 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -432,7 +432,7 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange)
 
         const bool bWasMapModeEnabled(rWindow.IsMapModeEnabled());
         rWindow.EnableMapMode(false);
-        GetPageView().GetView().InvalidateWindow(aVCLDiscreteRectangle, rWindow);
+        GetPageView().GetView().InvalidateOneWin(rWindow, aVCLDiscreteRectangle);
         rWindow.EnableMapMode(bWasMapModeEnabled);
     }
     else if (comphelper::LibreOfficeKit::isActive())
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 7adda28c0e84..666a81c92312 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -225,12 +225,6 @@ rtl::Reference<sdr::overlay::OverlayManager> SdrPaintView::CreateOverlayManager(
     return xOverlayManager;
 }
 
-void SdrPaintView::InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const
-{
-    vcl::Window& rWindow(static_cast<vcl::Window&>(rDevice));
-    rWindow.Invalidate(rArea, InvalidateFlags::NoErase);
-}
-
 void SdrPaintWindow::impCreateOverlayManager()
 {
     // not yet one created?
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index ebbbe8deca15..426f883447f0 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -670,7 +670,7 @@ void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const
                 aR.AdjustRight(aSiz.Width() );
                 aR.AdjustTop( -(aSiz.Height()) );
                 aR.AdjustBottom(aSiz.Height() );
-                const_cast<SdrView&>(GetView()).InvalidateOneWin(static_cast<vcl::Window&>(rOutDev), aR);
+                const_cast<SdrView&>(GetView()).InvalidateOneWin(rOutDev, aR);
             }
         }
     }
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index cbac5517dfab..458a22f60bc2 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -859,7 +859,7 @@ void SdrPaintView::InvalidateAllWin()
 
         if(pPaintWindow->OutputToWindow())
         {
-            InvalidateOneWin(static_cast<vcl::Window&>(pPaintWindow->GetOutputDevice()));
+            InvalidateOneWin(pPaintWindow->GetOutputDevice());
         }
     }
 }
@@ -884,20 +884,22 @@ void SdrPaintView::InvalidateAllWin(const tools::Rectangle& rRect)
             // In case of tiled rendering we want to get all invalidations, so visual area is not interesting.
             if (aRect.IsOver(aOutRect) || comphelper::LibreOfficeKit::isActive())
             {
-                InvalidateOneWin(static_cast<vcl::Window&>(rOutDev), aRect);
+                InvalidateOneWin(rOutDev, aRect);
             }
         }
     }
 }
 
-void SdrPaintView::InvalidateOneWin(vcl::Window& rWin)
+void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice)
 {
+    vcl::Window& rWin(static_cast<vcl::Window&>(rDevice));
     // do not erase background, that causes flicker (!)
     rWin.Invalidate(InvalidateFlags::NoErase);
 }
 
-void SdrPaintView::InvalidateOneWin(vcl::Window& rWin, const tools::Rectangle& rRect)
+void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice, const tools::Rectangle& rRect)
 {
+    vcl::Window& rWin(static_cast<vcl::Window&>(rDevice));
     // do not erase background, that causes flicker (!)
     rWin.Invalidate(rRect, InvalidateFlags::NoErase);
 }


More information about the Libreoffice-commits mailing list