summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-08-22 17:30:03 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-08-22 17:30:03 +0200
commit3f89eccf7e4a0a398a02624e2478de805723f92b (patch)
tree79a062b8e1f1376aca46d0fbdbb97933f6db51c8 /tools
parent8d6697587776136f3121733e1c29d4200720dbd9 (diff)
Do not cripple intermediate values to sal_uInt16
Change-Id: I5d39bebbd55cc3170ff52459731fad333a2e92f9
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/poly.cxx16
1 files changed, 8 insertions, 8 deletions
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;