From 50d3ad9127aaf63afcfa299adcea060c9b09faa4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 16 Nov 2020 16:07:30 +0100 Subject: 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 --- starmath/source/node.cxx | 3 ++- starmath/source/rect.cxx | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'starmath') 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 #include +#include #include #include #include @@ -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(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 #include +#include 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); } -- cgit