diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-20 14:22:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-20 16:27:08 +0200 |
commit | 6a1dea1d7a1c7ede887c66e6fd2ddecedf5404b9 (patch) | |
tree | cc6766dd55ccf6a9971246813771e4c994b3f7a4 /tools | |
parent | 0dfbdb1201c533a8fe2951cf3faf2a88f3855244 (diff) |
Revert "ofz#33769 Integer-overflow"
now fixed at an earlier stage so NaN isn't imported from dxf
This reverts commit 71fe0aeee20640c57816dc45010d32dac9afeaaf.
Change-Id: Id2689e33f89deb08e1bcd39a6d4ba38fb4663681
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117511
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/poly.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 857a1a8e7cbb..9d5f63fc65e9 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -57,7 +57,7 @@ static double ImplGetParameter( const Point& rCenter, const Point& rPt, double fWR, double fHR ) { const tools::Long nDX = rPt.X() - rCenter.X(); - double fAngle = atan2( o3tl::saturating_toggle_sign(rPt.Y()) + rCenter.Y(), ( ( nDX == 0 ) ? 0.000000001 : nDX ) ); + double fAngle = atan2( -rPt.Y() + rCenter.Y(), ( ( nDX == 0 ) ? 0.000000001 : nDX ) ); return atan2(fWR*sin(fAngle), fHR*cos(fAngle)); } @@ -236,8 +236,8 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c // tdf#142268 Get Top Left corner of rectangle (the rectangle is not always correctly created) const auto aBoundLeft = rBound.Left() < aCenter.X() ? rBound.Left() : rBound.Right(); const auto aBoundTop = rBound.Top() < aCenter.Y() ? rBound.Top() : rBound.Bottom(); - const auto nRadX = o3tl::saturating_sub(aCenter.X(), aBoundLeft); - const auto nRadY = o3tl::saturating_sub(aCenter.Y(), aBoundTop); + const auto nRadX = aCenter.X() - aBoundLeft; + const auto nRadY = aCenter.Y() - aBoundTop; sal_uInt16 nPoints; tools::Long nRadXY; @@ -255,7 +255,7 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c } - if (nRadX > 32 && nRadY > 32 && o3tl::saturating_add(nRadX, nRadY) < 8192) + if( ( nRadX > 32 ) && ( nRadY > 32 ) && ( nRadX + nRadY ) < 8192 ) nPoints >>= 1; // compute threshold |