basegfx/source/color/bcolormodifier.cxx | 2 +- basegfx/source/tools/bgradient.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit b0f26f460c8f9afceaaf0aa26de3ebfa1bf2cefa Author: Bogdan Buzea <buzea.bog...@libreoffice.org> AuthorDate: Fri Mar 22 20:07:40 2024 +0100 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Mar 26 17:26:53 2024 +0100 tdf#160084 Simplify comparison for basegfx::fTools Change-Id: If1a2d000e7059856280bd1acb959b35c412777df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165184 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/basegfx/source/color/bcolormodifier.cxx b/basegfx/source/color/bcolormodifier.cxx index 75c06f5cb8f3..3b9d1ce158c3 100644 --- a/basegfx/source/color/bcolormodifier.cxx +++ b/basegfx/source/color/bcolormodifier.cxx @@ -331,7 +331,7 @@ namespace basegfx BColorModifier_gamma::BColorModifier_gamma(double fValue) : mfValue(fValue), mfInvValue(fValue), - mbUseIt(!basegfx::fTools::equal(fValue, 1.0) && basegfx::fTools::more(fValue, 0.0) && basegfx::fTools::lessOrEqual(fValue, 10.0)) + mbUseIt(!basegfx::fTools::equal(fValue, 1.0) && fValue > 0.0 && basegfx::fTools::lessOrEqual(fValue, 10.0)) { if(mbUseIt) { diff --git a/basegfx/source/tools/bgradient.cxx b/basegfx/source/tools/bgradient.cxx index ffa75a898c53..9f98c54cfc1c 100644 --- a/basegfx/source/tools/bgradient.cxx +++ b/basegfx/source/tools/bgradient.cxx @@ -332,13 +332,13 @@ void BColorStops::sortAndCorrect() // get offset of entry at read position double fOff((*this)[read].getStopOffset()); - if (basegfx::fTools::less(fOff, 0.0) && read + 1 < size()) + if (fOff < 0.0 && read + 1 < size()) { // value < 0.0 and we have a next entry. check for gradient snippet // containing 0.0 resp. StartColor const double fOff2((*this)[read + 1].getStopOffset()); - if (basegfx::fTools::more(fOff2, 0.0)) + if (fOff2 > 0.0) { // read is the start of a gradient snippet containing 0.0. Correct // entry to StartColor, interpolate to correct StartColor @@ -353,7 +353,7 @@ void BColorStops::sortAndCorrect() } // step over < 0 values, these are outside and will be removed - if (basegfx::fTools::less(fOff, 0.0)) + if (fOff < 0.0) { continue; } @@ -410,7 +410,7 @@ void BColorStops::sortAndCorrect() // no valid entries at all, but not empty. This can only happen // when all entries are below 0.0 or above 1.0 (else a gradient // snippet spawning over both would have been detected) - if (basegfx::fTools::less(back().getStopOffset(), 0.0)) + if (back().getStopOffset() < 0.0) { // all outside too low, rescue last due to being closest to content const BColor aBackColor(back().getStopColor());