vcl/source/outdev/hatch.cxx |   38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 790d17beb823f59f59564806925122e175991cbc
Author:     Christopher Sherlock <[email protected]>
AuthorDate: Thu Aug 14 23:51:36 2025 +1000
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Aug 15 22:27:42 2025 +0200

    vcl: flatten OutputDevice::DrawHatch()
    
    Change-Id: Ie615a93c4f81130cdea280f9ee1160b5db754791
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189611
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx
index c329a9f89e24..06e11593f2ed 100644
--- a/vcl/source/outdev/hatch.cxx
+++ b/vcl/source/outdev/hatch.cxx
@@ -198,10 +198,26 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& 
rPolyPoly, const Hatch&
         while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) );
     }
 
-    if( ( rHatch.GetStyle() == HatchStyle::Double ) || ( rHatch.GetStyle() == 
HatchStyle::Triple ) )
+    if (rHatch.GetStyle() != HatchStyle::Double && rHatch.GetStyle() != 
HatchStyle::Triple)
+        return;
+
+    // Double hatch
+    CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 900_deg10, aPt1, aPt2, 
aInc, aEndPt1 );
+    if (comphelper::IsFuzzing() && !HasSaneNSteps(aPt1, aEndPt1, aInc))
+        return;
+
+    do
+    {
+        DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), 
bMtf );
+        aPt1.AdjustX(aInc.Width() ); aPt1.AdjustY(aInc.Height() );
+        aPt2.AdjustX(aInc.Width() ); aPt2.AdjustY(aInc.Height() );
+    }
+    while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) );
+
+    if( rHatch.GetStyle() == HatchStyle::Triple )
     {
-        // Double hatch
-        CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 900_deg10, aPt1, 
aPt2, aInc, aEndPt1 );
+        // Triple hatch
+        CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 450_deg10, aPt1, 
aPt2, aInc, aEndPt1 );
         if (comphelper::IsFuzzing() && !HasSaneNSteps(aPt1, aEndPt1, aInc))
             return;
 
@@ -212,22 +228,6 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& 
rPolyPoly, const Hatch&
             aPt2.AdjustX(aInc.Width() ); aPt2.AdjustY(aInc.Height() );
         }
         while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) );
-
-        if( rHatch.GetStyle() == HatchStyle::Triple )
-        {
-            // Triple hatch
-            CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 450_deg10, 
aPt1, aPt2, aInc, aEndPt1 );
-            if (comphelper::IsFuzzing() && !HasSaneNSteps(aPt1, aEndPt1, aInc))
-                return;
-
-            do
-            {
-                DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, 
pPtBuffer.get(), bMtf );
-                aPt1.AdjustX(aInc.Width() ); aPt1.AdjustY(aInc.Height() );
-                aPt2.AdjustX(aInc.Width() ); aPt2.AdjustY(aInc.Height() );
-            }
-            while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) 
);
-        }
     }
 }
 

Reply via email to