diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-16 16:07:30 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-16 21:43:09 +0100 |
commit | 50d3ad9127aaf63afcfa299adcea060c9b09faa4 (patch) | |
tree | af3bf48ae8e31e180003c9f998831dd7777d1f5b /starmath | |
parent | cd4a239063a77d49fe178255c20f0558e337a82f (diff) |
Instead of labs, use overloaded abs
...more likely to pick an appropriate version for the involved integer types,
esp. after the recent long -> tools::Long changes
Change-Id: Ia91259ca35aaf74b0e907de6831fc926f30057f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/node.cxx | 3 | ||||
-rw-r--r-- | starmath/source/rect.cxx | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 3c78de3ba5b0..9408e62dbdfa 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -39,6 +39,7 @@ #include <rtl/math.hxx> #include <cassert> +#include <cstdlib> #include <math.h> #include <memory> #include <float.h> @@ -871,7 +872,7 @@ bool IsPointInLine(const Point &rPoint1, static const double eps = 5.0 * DBL_EPSILON; double fLambda; - if (labs(rHeading2.X()) > labs(rHeading2.Y())) + if (std::abs(rHeading2.X()) > std::abs(rHeading2.Y())) { fLambda = (rPoint1.X() - rPoint2.X()) / static_cast<double>(rHeading2.X()); bRes = fabs(rPoint1.Y() - (rPoint2.Y() + fLambda * rHeading2.Y())) < eps; diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index 1c9ecb71ccdc..e3506c67de77 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -30,6 +30,7 @@ #include <smmod.hxx> #include <cassert> +#include <cstdlib> namespace { @@ -588,8 +589,8 @@ tools::Long SmRect::OrientedDist(const Point &rPoint) const // build distance vector Point aDist (aRef - rPoint); - tools::Long nAbsX = labs(aDist.X()), - nAbsY = labs(aDist.Y()); + tools::Long nAbsX = std::abs(aDist.X()), + nAbsY = std::abs(aDist.Y()); return bIsInside ? - std::min(nAbsX, nAbsY) : std::max (nAbsX, nAbsY); } |