vcl/headless/SvpGraphicsBackend.cxx             |    2 --
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   14 ++++----------
 2 files changed, 4 insertions(+), 12 deletions(-)

New commits:
commit b62e3e164ef6af83e03e106e188c06eb5b91f51d
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Jan 2 21:03:45 2023 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Wed Jan 4 19:24:24 2023 +0000

    sync drawPolyLine impls early returns
    
    Change-Id: I9b7c49d0e4286245979043e1cb21f8b577676f87
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144972
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/headless/SvpGraphicsBackend.cxx 
b/vcl/headless/SvpGraphicsBackend.cxx
index a47332173676..355a971b9b01 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -360,9 +360,7 @@ bool SvpGraphicsBackend::drawPolyLine(const 
basegfx::B2DHomMatrix& rObjectToDevi
 {
     // short circuit if there is nothing to do
     if (0 == rPolyLine.count() || fTransparency < 0.0 || fTransparency >= 1.0)
-    {
         return true;
-    }
 
     // Wrap call to static version of ::drawPolyLine by
     // preparing/getting some local data and parameters
diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
index 874bf4bd4cf8..438aaf46b455 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
@@ -126,22 +126,16 @@ bool X11CairoSalGraphicsImpl::drawPolyPolygon(const 
basegfx::B2DHomMatrix& rObje
 }
 
 bool X11CairoSalGraphicsImpl::drawPolyLine(const basegfx::B2DHomMatrix& 
rObjectToDevice,
-                                           const basegfx::B2DPolygon& rPolygon,
+                                           const basegfx::B2DPolygon& 
rPolyLine,
                                            double fTransparency, double 
fLineWidth,
                                            const std::vector<double>* pStroke,
                                            basegfx::B2DLineJoin eLineJoin,
                                            css::drawing::LineCap eLineCap,
                                            double fMiterMinimumAngle, bool 
bPixelSnapHairline)
 {
-    if (0 == rPolygon.count())
-    {
+    // short circuit if there is nothing to do
+    if (0 == rPolyLine.count() || fTransparency < 0.0 || fTransparency >= 1.0)
         return true;
-    }
-
-    if (fTransparency >= 1.0)
-    {
-        return true;
-    }
 
     cairo_t* cr = mrX11Common.getCairoContext();
     clipRegion(cr);
@@ -149,7 +143,7 @@ bool X11CairoSalGraphicsImpl::drawPolyLine(const 
basegfx::B2DHomMatrix& rObjectT
     // Use the now available static drawPolyLine from the 
Cairo-Headless-Fallback
     // that will take care of all needed stuff
     const bool bRetval(CairoCommon::drawPolyLine(
-        cr, nullptr, mnPenColor, getAntiAlias(), rObjectToDevice, rPolygon, 
fTransparency,
+        cr, nullptr, mnPenColor, getAntiAlias(), rObjectToDevice, rPolyLine, 
fTransparency,
         fLineWidth, pStroke, eLineJoin, eLineCap, fMiterMinimumAngle, 
bPixelSnapHairline));
 
     X11Common::releaseCairoContext(cr);

Reply via email to