diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-18 15:10:54 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-23 17:27:47 +0200 |
commit | 23e1fc277d5651babce17bb74408ef6505f101d2 (patch) | |
tree | edf64a973766400f870095f4ecd25784bfea6ba5 /tools/source/generic/poly.cxx | |
parent | 7f895dfbf5fb084d747e52db678d75e3273cd825 (diff) |
loplugin: cstylecast, update PTR_CAST macro to use static_cast
I introduce a template method into the PTR_CAST machinery
to maintain constness.
There is now a FIXME in sd/../docshell.cxx because I needed
to use a dynamic_cast there to work around the games it appears
to be playing with OLE in-place activation.
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
dropping the GCC-extension, unnecessary use of typeof from tools/rtti.hxx
Change-Id: Iba5ace1aa27e02b34fcc91af1e658c43371afd03
Diffstat (limited to 'tools/source/generic/poly.cxx')
-rw-r--r-- | tools/source/generic/poly.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index e5ed7f2762b2..aaa780f29982 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -310,7 +310,7 @@ inline double ImplGetParameter( const Point& rCenter, const Point& rPt, double f Polygon::Polygon() { - mpImplPolygon = (ImplPolygon*)(&aStaticImplPolygon); + mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); } Polygon::Polygon( sal_uInt16 nSize ) @@ -319,7 +319,7 @@ Polygon::Polygon( sal_uInt16 nSize ) if ( nSize ) mpImplPolygon = new ImplPolygon( nSize ); else - mpImplPolygon = (ImplPolygon*)(&aStaticImplPolygon); + mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); } Polygon::Polygon( sal_uInt16 nPoints, const Point* pPtAry, const sal_uInt8* pFlagAry ) @@ -328,7 +328,7 @@ Polygon::Polygon( sal_uInt16 nPoints, const Point* pPtAry, const sal_uInt8* pFla if( nPoints ) mpImplPolygon = new ImplPolygon( nPoints, pPtAry, pFlagAry ); else - mpImplPolygon = (ImplPolygon*)(&aStaticImplPolygon); + mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); } Polygon::Polygon( const Polygon& rPoly ) @@ -344,7 +344,7 @@ Polygon::Polygon( const Rectangle& rRect ) { if ( rRect.IsEmpty() ) - mpImplPolygon = (ImplPolygon*)(&aStaticImplPolygon); + mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); else { mpImplPolygon = new ImplPolygon( 5 ); @@ -359,7 +359,7 @@ Polygon::Polygon( const Rectangle& rRect ) Polygon::Polygon( const Rectangle& rRect, sal_uIntPtr nHorzRound, sal_uIntPtr nVertRound ) { if ( rRect.IsEmpty() ) - mpImplPolygon = (ImplPolygon*)(&aStaticImplPolygon); + mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); else { Rectangle aRect( rRect ); @@ -455,7 +455,7 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, sal_uInt16 nPoin } } else - mpImplPolygon = (ImplPolygon*)(&aStaticImplPolygon); + mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); } Polygon::Polygon( const Rectangle& rBound, const Point& rStart, const Point& rEnd, @@ -530,7 +530,7 @@ Polygon::Polygon( const Rectangle& rBound, const Point& rStart, const Point& rEn mpImplPolygon->mpPointAry[ nPoints ] = mpImplPolygon->mpPointAry[ 0 ]; } else - mpImplPolygon = (ImplPolygon*) &aStaticImplPolygon; + mpImplPolygon = static_cast<ImplPolygon*>( &aStaticImplPolygon ); } Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1, @@ -677,7 +677,7 @@ void Polygon::Clear() delete mpImplPolygon; } - mpImplPolygon = (ImplPolygon*)(&aStaticImplPolygon); + mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); } double Polygon::CalcDistance( sal_uInt16 nP1, sal_uInt16 nP2 ) @@ -1934,7 +1934,7 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon) if(!mpImplPolygon) { // no content yet, create empty polygon - mpImplPolygon = (ImplPolygon*)(&aStaticImplPolygon); + mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); } } |