Kaydet (Commit) 3f89eccf authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Do not cripple intermediate values to sal_uInt16

Change-Id: I5d39bebbd55cc3170ff52459731fad333a2e92f9
üst 8d669758
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment