summaryrefslogtreecommitdiff
path: root/svx/source/customshapes
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-03 21:08:57 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-05 21:18:02 +0200
commitacb923263e3a15f9cd8fda46d28a749c7496d113 (patch)
tree1f03f032b240ed5dba3fa09a98035ee9ec7e2f36 /svx/source/customshapes
parent6b95231a2c6f9ae6ec544f9281c4ddc6d665c9dc (diff)
Improved loplugin:cstylecast to reference types: svx
Change-Id: Idb58ca86ea6c0593283c455880ca7c0e99983c60
Diffstat (limited to 'svx/source/customshapes')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx24
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx4
2 files changed, 14 insertions, 14 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index c4de12bbcfc3..26fbc948bf94 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -537,13 +537,13 @@ bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryItem& rGeometryItem )
{
// AdjustmentValues
- const Any* pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "AdjustmentValues" );
+ const Any* pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( "AdjustmentValues" );
if ( pAny )
*pAny >>= seqAdjustmentValues;
// Coordsize
- const Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "ViewBox" );
+ const Any* pViewBox = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( "ViewBox" );
css::awt::Rectangle aViewBox;
if ( pViewBox && (*pViewBox >>= aViewBox ) )
{
@@ -556,31 +556,31 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt
// Path/Coordinates
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "Coordinates" );
+ pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "Coordinates" );
if ( pAny )
*pAny >>= seqCoordinates;
// Path/GluePoints
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "GluePoints" );
+ pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "GluePoints" );
if ( pAny )
*pAny >>= seqGluePoints;
// Path/Segments
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "Segments" );
+ pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "Segments" );
if ( pAny )
*pAny >>= seqSegments;
// Path/SubViewSize
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "SubViewSize" );
+ pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "SubViewSize" );
if ( pAny )
*pAny >>= seqSubViewSize;
// Path/StretchX
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "StretchX" );
+ pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "StretchX" );
if ( pAny )
{
sal_Int32 nStretchX = 0;
@@ -590,7 +590,7 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt
// Path/StretchY
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "StretchY" );
+ pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "StretchY" );
if ( pAny )
{
sal_Int32 nStretchY = 0;
@@ -600,19 +600,19 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt
// Path/TextFrames
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "TextFrames" );
+ pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "TextFrames" );
if ( pAny )
*pAny >>= seqTextFrames;
// Equations
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "Equations" );
+ pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( "Equations" );
if ( pAny )
*pAny >>= seqEquations;
// Handles
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "Handles" );
+ pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( "Handles" );
if ( pAny )
*pAny >>= seqHandles;
}
@@ -1632,7 +1632,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_Int32& rSrcPt, sal_Int32& rSegmen
_aCenter.Y() = nCoordHeight/2 * fYScale;
fWidth = nCoordWidth/2;
fHeight = nCoordHeight/2;
- const Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "ViewBox" );
+ const Any* pViewBox = rGeometryItem.GetPropertyValueByName( "ViewBox" );
css::awt::Rectangle aViewBox;
if ( pViewBox && (*pViewBox >>= aViewBox ) )
{
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index a264b93939df..cefeb456d3e3 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -139,7 +139,7 @@ double GetLength( const tools::Polygon& rPolygon )
{
sal_uInt16 nCount = rPolygon.GetSize();
while( --nCount )
- fLength += ((tools::Polygon&)rPolygon).CalcDistance( nCount, nCount - 1 );
+ fLength += const_cast<tools::Polygon&>(rPolygon).CalcDistance( nCount, nCount - 1 );
}
return fLength;
}
@@ -536,7 +536,7 @@ void CalcDistances( const tools::Polygon& rPoly, std::vector< double >& rDistanc
{
for ( i = 0; i < nCount; i++ )
{
- double fDistance = i ? ((tools::Polygon&)rPoly).CalcDistance( i, i - 1 ) : 0.0;
+ double fDistance = i ? const_cast<tools::Polygon&>(rPoly).CalcDistance( i, i - 1 ) : 0.0;
rDistances.push_back( fDistance );
}
std::partial_sum( rDistances.begin(), rDistances.end(), rDistances.begin() );