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 /tools | |
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 'tools')
-rw-r--r-- | tools/source/generic/poly.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index c25783764f27..5a4a79be984c 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -40,6 +40,7 @@ #include <vector> #include <iterator> #include <algorithm> +#include <cstdlib> #include <cstring> #include <limits.h> #include <cmath> @@ -122,8 +123,8 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rRect, sal_uInt32 nHorzRound, tools::Rectangle aRect( rRect ); aRect.Justify(); // SJ: i9140 - nHorzRound = std::min( nHorzRound, static_cast<sal_uInt32>(labs( aRect.GetWidth() >> 1 )) ); - nVertRound = std::min( nVertRound, static_cast<sal_uInt32>(labs( aRect.GetHeight() >> 1 )) ); + nHorzRound = std::min( nHorzRound, static_cast<sal_uInt32>(std::abs( aRect.GetWidth() >> 1 )) ); + nVertRound = std::min( nVertRound, static_cast<sal_uInt32>(std::abs( aRect.GetHeight() >> 1 )) ); if( !nHorzRound && !nVertRound ) { @@ -179,7 +180,7 @@ ImplPolygon::ImplPolygon( const Point& rCenter, tools::Long nRadX, tools::Long n { nPoints = static_cast<sal_uInt16>(MinMax( ( F_PI * ( 1.5 * ( nRadX + nRadY ) - - sqrt( static_cast<double>(labs(nRadXY)) ) ) ), + sqrt( static_cast<double>(std::abs(nRadXY)) ) ) ), 32, 256 )); } else @@ -242,7 +243,7 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c { nPoints = static_cast<sal_uInt16>(MinMax( ( F_PI * ( 1.5 * ( nRadX + nRadY ) - - sqrt( static_cast<double>(labs(nRadXY)) ) ) ), + sqrt( static_cast<double>(std::abs(nRadXY)) ) ) ), 32, 256 )); } else |