drawinglayer/source/animation/animationtiming.cxx          |    2 +-
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx |    2 +-
 drawinglayer/source/primitive2d/textprimitive2d.cxx        |    4 ++--
 drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx |    4 ++--
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |    2 +-
 drawinglayer/source/texture/texture.cxx                    |    8 ++++----
 6 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 68c04836ab5af32c06650c0f1f7fe39e3a0753bb
Author:     RMZeroFour <[email protected]>
AuthorDate: Mon Apr 1 01:48:20 2024 +0530
Commit:     Xisco Fauli <[email protected]>
CommitDate: Thu Apr 18 15:19:33 2024 +0200

    tdf#160084 Simplify comparing with zero when using fTools
    
    As part of the efforts in #160084 to simplify parts of the codebase
    by replacing basegfx::fTools::more/less calls with direct comparisions
    against zero, this commit performs the changes in a few files in the
    drawinglayer/ module.
    
    PS-2: Fix wrong identifier, courtesy of an accidental backspace press...
    
    Change-Id: I52a183dda5ae11989f8ffc8b26ff16ac77d6ebb1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165600
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/drawinglayer/source/animation/animationtiming.cxx 
b/drawinglayer/source/animation/animationtiming.cxx
index 11f512722a50..364ae899c9ca 100644
--- a/drawinglayer/source/animation/animationtiming.cxx
+++ b/drawinglayer/source/animation/animationtiming.cxx
@@ -116,7 +116,7 @@ namespace drawinglayer::animation
 
         double AnimationEntryLinear::getStateAtTime(double fTime) const
         {
-            if(basegfx::fTools::more(mfDuration, 0.0))
+            if(mfDuration > 0.0)
             {
                 const double fFactor(fTime / mfDuration);
 
diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx 
b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
index 1bf263a50f71..24f979ce2c9d 100644
--- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
@@ -539,7 +539,7 @@ namespace drawinglayer::primitive2d
                 Primitive2DContainer aTargetColor;
                 Primitive2DContainer aTargetOpacity;
 
-                if(basegfx::fTools::more(aUnitRange.getWidth(), 0.0))
+                if(aUnitRange.getWidth() > 0.0)
                 {
                     // add a pre-multiply to aUnitGradientToObject to allow
                     // multiplication of the polygon(xl, 0.0, xr, 1.0)
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx 
b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index 676c451a934c..2d91785c5287 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -53,7 +53,7 @@ basegfx::B2DVector 
getCorrectedScaleAndFontScale(basegfx::B2DVector& rScale)
         rScale.setY(1.0 / fDefaultFontScale);
         aFontScale.setY(fDefaultFontScale);
     }
-    else if (basegfx::fTools::less(aFontScale.getY(), 0.0))
+    else if (aFontScale.getY() < 0.0)
     {
         // negative font height; invert and adapt scale to get back to 
original scaling
         aFontScale.setY(-aFontScale.getY());
@@ -101,7 +101,7 @@ void 
TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(
 
     // handle special case: If scale is negative in (x,y) (3rd quadrant), it 
can
     // be expressed as rotation by PI
-    if (basegfx::fTools::less(aScale.getX(), 0.0) && 
basegfx::fTools::less(aScale.getY(), 0.0))
+    if (aScale.getX() < 0.0 && aScale.getY() < 0.0)
     {
         aScale = basegfx::absolute(aScale);
         fRotate += M_PI;
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx 
b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index 2b015fdad39b..672c78463a7d 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -517,7 +517,7 @@ using namespace com::sun::star;
 
             if(nPointCount)
             {
-                if(basegfx::fTools::more(getRadius(), 0.0))
+                if(getRadius() > 0.0)
                 {
                     const attribute::MaterialAttribute3D 
aMaterial(getBColor());
                     static const sal_uInt32 nSegments(8); // default for 3d 
line segments, for more quality just raise this value (in even steps)
@@ -534,7 +534,7 @@ using namespace com::sun::star;
                         const basegfx::B3DVector aForw(aNext - aCurr);
                         const double fForwLen(aForw.getLength());
 
-                        if(basegfx::fTools::more(fForwLen, 0.0))
+                        if(fForwLen > 0.0)
                         {
                             // find out if linecap is active
                             const bool bFirst(!a);
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 7b3acd6a1e74..d93d98fef51a 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1633,7 +1633,7 @@ void 
VclMetafileProcessor2D::processPolygonStrokePrimitive2D(
         const attribute::LineAttribute& rLine = 
rStrokePrimitive.getLineAttribute();
 
         // create MetaPolyLineActions, but without LineStyle::Dash
-        if (basegfx::fTools::more(rLine.getWidth(), 0.0))
+        if (rLine.getWidth() > 0.0)
         {
             const attribute::StrokeAttribute& rStroke = 
rStrokePrimitive.getStrokeAttribute();
 
diff --git a/drawinglayer/source/texture/texture.cxx 
b/drawinglayer/source/texture/texture.cxx
index ccfaa13bd8bf..b965e0e4b933 100644
--- a/drawinglayer/source/texture/texture.cxx
+++ b/drawinglayer/source/texture/texture.cxx
@@ -1024,7 +1024,7 @@ namespace drawinglayer::texture
             sal_Int32 nPosX(0);
             sal_Int32 nPosY(0);
 
-            if(basegfx::fTools::more(fStartX, 0.0))
+            if(fStartX > 0.0)
             {
                 const sal_Int32 nDiff(static_cast<sal_Int32>(floor(fStartX / 
fWidth)) + 1);
 
@@ -1032,7 +1032,7 @@ namespace drawinglayer::texture
                 fStartX -= nDiff * fWidth;
             }
 
-            if(basegfx::fTools::less(fStartX + fWidth, 0.0))
+            if((fStartX + fWidth) < 0.0)
             {
                 const sal_Int32 nDiff(static_cast<sal_Int32>(floor(-fStartX / 
fWidth)));
 
@@ -1040,7 +1040,7 @@ namespace drawinglayer::texture
                 fStartX += nDiff * fWidth;
             }
 
-            if(basegfx::fTools::more(fStartY, 0.0))
+            if(fStartY > 0.0)
             {
                 const sal_Int32 nDiff(static_cast<sal_Int32>(floor(fStartY / 
fHeight)) + 1);
 
@@ -1048,7 +1048,7 @@ namespace drawinglayer::texture
                 fStartY -= nDiff * fHeight;
             }
 
-            if(basegfx::fTools::less(fStartY + fHeight, 0.0))
+            if((fStartY + fHeight) < 0.0)
             {
                 const sal_Int32 nDiff(static_cast<sal_Int32>(floor(-fStartY / 
fHeight)));
 

Reply via email to