From 3f89eccf7e4a0a398a02624e2478de805723f92b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 22 Aug 2014 17:30:03 +0200 Subject: Do not cripple intermediate values to sal_uInt16 Change-Id: I5d39bebbd55cc3170ff52459731fad333a2e92f9 --- tools/source/generic/poly.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tools/source/generic') diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 244727169571..e5ed7f2762b2 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -416,10 +416,10 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, sal_uInt16 nPoin // Compute default (depends on size) if( !nPoints ) { - nPoints = (sal_uInt16) ( F_PI * ( 1.5 * ( nRadX + nRadY ) - - sqrt( (double) labs( nRadX * nRadY ) ) ) ); - - nPoints = (sal_uInt16) MinMax( nPoints, 32, 256 ); + nPoints = (sal_uInt16) MinMax( + ( F_PI * ( 1.5 * ( nRadX + nRadY ) - + sqrt( (double) labs( nRadX * nRadY ) ) ) ), + 32, 256 ); if( ( nRadX > 32 ) && ( nRadY > 32 ) && ( nRadX + nRadY ) < 8192 ) nPoints >>= 1; @@ -471,10 +471,10 @@ Polygon::Polygon( const Rectangle& rBound, const Point& rStart, const Point& rEn const long nRadY = aCenter.Y() - rBound.Top(); sal_uInt16 nPoints; - nPoints = (sal_uInt16) ( F_PI * ( 1.5 * ( nRadX + nRadY ) - - sqrt( (double) labs( nRadX * nRadY ) ) ) ); - - nPoints = (sal_uInt16) MinMax( nPoints, 32, 256 ); + nPoints = (sal_uInt16) MinMax( + ( F_PI * ( 1.5 * ( nRadX + nRadY ) - + sqrt( (double) labs( nRadX * nRadY ) ) ) ), + 32, 256 ); if( ( nRadX > 32 ) && ( nRadY > 32 ) && ( nRadX + nRadY ) < 8192 ) nPoints >>= 1; -- cgit