[Libreoffice-commits] core.git: vcl/source

Chris Sherlock (via logerrit) logerrit at kemper.freedesktop.org
Fri May 15 06:09:24 UTC 2020


 vcl/source/gdi/print2.cxx |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit f8820fea3f0c3c50a9755351a33dde9b082e6456
Author:     Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Tue May 12 06:31:39 2020 +1000
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Fri May 15 08:08:48 2020 +0200

    vcl: refactor - move rect coverage check out of checkRect
    
    Change-Id: I68d24fd0b94286155750ccb5fa83bf7a897ada5c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94021
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index d60ba034742c..481cafcf814e 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -89,6 +89,17 @@ bool DoesActionHandleTransparency( const MetaAction& rAct )
     }
 }
 
+bool doesRectCoverWithUniformColor(
+        tools::Rectangle const & rPrevRect,
+        tools::Rectangle const & rCurrRect,
+        OutputDevice const & rMapModeVDev)
+{
+    // shape needs to fully cover previous content, and have uniform
+    // color
+    return (rMapModeVDev.LogicToPixel(rCurrRect).IsInside(rPrevRect) &&
+        rMapModeVDev.IsFillColor());
+}
+
 /** Check whether rCurrRect rectangle fully covers io_rPrevRect - if
     yes, return true and update o_rBgColor
  */
@@ -97,11 +108,7 @@ bool checkRect( tools::Rectangle&       io_rPrevRect,
                        const tools::Rectangle& rCurrRect,
                        OutputDevice const &    rMapModeVDev )
 {
-    // shape needs to fully cover previous content, and have uniform
-    // color
-    const bool bRet(
-        rMapModeVDev.LogicToPixel(rCurrRect).IsInside(io_rPrevRect) &&
-        rMapModeVDev.IsFillColor() );
+    bool bRet = doesRectCoverWithUniformColor(io_rPrevRect, rCurrRect, rMapModeVDev);
 
     if( bRet )
     {


More information about the Libreoffice-commits mailing list