summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-15 09:05:39 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-15 09:05:39 +0100
commit5906792ea5d4039a01cd563a8d32487a0189e680 (patch)
tree493d04466a8b47012a8273444945b4d4bd14de3d
parentc6a62b3694b8d779f9385c0e15d8f94d5067416d (diff)
More loplugin:cstylecast: filter
Change-Id: I65244623321e409b48915abea3dee49abee47249
-rw-r--r--filter/source/config/cache/filtercache.cxx4
-rw-r--r--filter/source/graphicfilter/icgm/actimpr.cxx10
-rw-r--r--filter/source/graphicfilter/icgm/class1.cxx4
-rw-r--r--filter/source/graphicfilter/icgm/class2.cxx10
-rw-r--r--filter/source/graphicfilter/icgm/class4.cxx4
-rw-r--r--filter/source/graphicfilter/icgm/class5.cxx20
-rw-r--r--filter/source/msfilter/escherex.cxx4
-rw-r--r--filter/source/msfilter/msdffimp.cxx57
-rw-r--r--filter/source/msfilter/svdfppt.cxx36
-rw-r--r--filter/source/pdf/pdfinteract.cxx2
-rw-r--r--filter/source/svg/svgexport.cxx10
-rw-r--r--filter/source/t602/t602filter.cxx2
12 files changed, 81 insertions, 82 deletions
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 1a00245c2ce3..c551e8f43bb0 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -1362,7 +1362,7 @@ void FilterCache::impl_load(EFillState eRequiredState)
}
// update fill state. Note: it's a bit field, which combines different parts.
- m_eFillState = (EFillState) (static_cast<sal_Int32>(m_eFillState) | static_cast<sal_Int32>(eRequiredState));
+ m_eFillState = static_cast<EFillState>(static_cast<sal_Int32>(m_eFillState) | static_cast<sal_Int32>(eRequiredState));
// any data readed?
// yes! => validate it and update optimized structures.
@@ -1637,7 +1637,7 @@ CacheItem FilterCache::impl_loadItem(const css::uno::Reference< css::container::
// int representation ...
css::uno::Sequence< OUString > lFlagNames;
if (aValues[i] >>= lFlagNames)
- aItem[rPropName] <<= (sal_Int32) FilterCache::impl_convertFlagNames2FlagField(lFlagNames);
+ aItem[rPropName] <<= static_cast<sal_Int32>(FilterCache::impl_convertFlagNames2FlagField(lFlagNames));
}
}
}
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index b58d5266ad84..b83f3c617d9f 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -655,7 +655,7 @@ void CGMImpressOutAct::DrawPolybezier( tools::Polygon& rPolygon )
for( sal_uInt16 i = 0; i < nPoints; i++ )
{
*pInnerSequence++ = awt::Point( rPolygon[ i ].X(), rPolygon[ i ].Y() );
- *pInnerFlags++ = (drawing::PolygonFlags)rPolygon.GetFlags( i );
+ *pInnerFlags++ = static_cast<drawing::PolygonFlags>(rPolygon.GetFlags( i ));
}
uno::Any aParam;
aParam <<= aRetval;
@@ -695,7 +695,7 @@ void CGMImpressOutAct::DrawPolyPolygon( tools::PolyPolygon const & rPolyPolygon
for( sal_uInt32 b = 0; b < nNumPoints; b++ )
{
*pInnerSequence++ = awt::Point( aPolygon.GetPoint( b ).X(), aPolygon.GetPoint( b ).Y() ) ;
- *pInnerFlags++ = (drawing::PolygonFlags)aPolygon.GetFlags( b );
+ *pInnerFlags++ = static_cast<drawing::PolygonFlags>(aPolygon.GetFlags( b ));
}
pOuterSequence++;
pOuterFlags++;
@@ -816,15 +816,15 @@ void CGMImpressOutAct::DrawText( awt::Point const & rTextPos, awt::Size const &
switch ( mpCGM->pElement->eTextAlignmentH )
{
case TAH_RIGHT :
- aAny <<= (sal_Int16)style::HorizontalAlignment_RIGHT;
+ aAny <<= sal_Int16(style::HorizontalAlignment_RIGHT);
break;
case TAH_LEFT :
case TAH_CONT :
case TAH_NORMAL :
- aAny <<= (sal_Int16)style::HorizontalAlignment_LEFT;
+ aAny <<= sal_Int16(style::HorizontalAlignment_LEFT);
break;
case TAH_CENTER :
- aAny <<= (sal_Int16)style::HorizontalAlignment_CENTER;
+ aAny <<= sal_Int16(style::HorizontalAlignment_CENTER);
break;
}
aCursorPropSet->setPropertyValue( "ParaAdjust", aAny );
diff --git a/filter/source/graphicfilter/icgm/class1.cxx b/filter/source/graphicfilter/icgm/class1.cxx
index ff04efb7f0de..3bd903796aab 100644
--- a/filter/source/graphicfilter/icgm/class1.cxx
+++ b/filter/source/graphicfilter/icgm/class1.cxx
@@ -196,13 +196,13 @@ void CGM::ImplDoClass1()
if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize)
throw css::uno::Exception("attempt to read past end of input", nullptr);
- pElement->aFontList.InsertCharSet( (CharSetType)nCharSetType, mpSource + mnParaSize, nSize );
+ pElement->aFontList.InsertCharSet( static_cast<CharSetType>(nCharSetType), mpSource + mnParaSize, nSize );
mnParaSize += nSize;
}
}
break;
case 0x0f : /*Character Coding Announcer*/
- pElement->eCharacterCodingA = (CharacterCodingA)ImplGetUI16();
+ pElement->eCharacterCodingA = static_cast<CharacterCodingA>(ImplGetUI16());
break;
case 0x10 : /*Name Precision */break; // NS
case 0x11 : /*Maximum VDC Extent */break; // NS
diff --git a/filter/source/graphicfilter/icgm/class2.cxx b/filter/source/graphicfilter/icgm/class2.cxx
index 23e972718992..05528fe280d8 100644
--- a/filter/source/graphicfilter/icgm/class2.cxx
+++ b/filter/source/graphicfilter/icgm/class2.cxx
@@ -144,7 +144,7 @@ void CGM::ImplDoClass2()
{
LineBundle aTempLineBundle;
aTempLineBundle.SetIndex( ImplGetI( pElement->nIndexPrecision ) );
- aTempLineBundle.eLineType = (LineType)ImplGetI( pElement->nIndexPrecision );
+ aTempLineBundle.eLineType = static_cast<LineType>(ImplGetI( pElement->nIndexPrecision ));
aTempLineBundle.nLineWidth = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
aTempLineBundle.SetColor( ImplGetBitmapColor() );
const bool bUpdateLineBundle = aTempLineBundle.GetIndex() == pElement->pLineBundle->GetIndex();
@@ -157,7 +157,7 @@ void CGM::ImplDoClass2()
{
MarkerBundle aTempMarkerBundle;
aTempMarkerBundle.SetIndex( ImplGetI( pElement->nIndexPrecision ) );
- aTempMarkerBundle.eMarkerType = (MarkerType)ImplGetI( pElement->nIndexPrecision );
+ aTempMarkerBundle.eMarkerType = static_cast<MarkerType>(ImplGetI( pElement->nIndexPrecision ));
aTempMarkerBundle.nMarkerSize = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
aTempMarkerBundle.SetColor( ImplGetBitmapColor() );
const bool bUpdateMarkerBundle = aTempMarkerBundle.GetIndex() == pElement->pMarkerBundle->GetIndex();
@@ -171,7 +171,7 @@ void CGM::ImplDoClass2()
TextBundle aTempTextBundle;
aTempTextBundle.SetIndex( ImplGetI( pElement->nIndexPrecision ) );
aTempTextBundle.nTextFontIndex = ImplGetI( pElement->nIndexPrecision );
- aTempTextBundle.eTextPrecision = (TextPrecision)ImplGetI( pElement->nIndexPrecision );
+ aTempTextBundle.eTextPrecision = static_cast<TextPrecision>(ImplGetI( pElement->nIndexPrecision ));
aTempTextBundle.nCharacterSpacing = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
aTempTextBundle.nCharacterExpansion = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
aTempTextBundle.SetColor( ImplGetBitmapColor() );
@@ -185,7 +185,7 @@ void CGM::ImplDoClass2()
{
FillBundle aTempFillBundle;
aTempFillBundle.SetIndex( ImplGetI( pElement->nIndexPrecision ) );
- aTempFillBundle.eFillInteriorStyle = (FillInteriorStyle)ImplGetI( pElement->nIndexPrecision );
+ aTempFillBundle.eFillInteriorStyle = static_cast<FillInteriorStyle>(ImplGetI( pElement->nIndexPrecision ));
aTempFillBundle.SetColor( ImplGetBitmapColor() );
aTempFillBundle.nFillPatternIndex = ImplGetI( pElement->nIndexPrecision );
aTempFillBundle.nFillHatchIndex = ImplGetI( pElement->nIndexPrecision );
@@ -199,7 +199,7 @@ void CGM::ImplDoClass2()
{
EdgeBundle aTempEdgeBundle;
aTempEdgeBundle.SetIndex( ImplGetI( pElement->nIndexPrecision ) );
- aTempEdgeBundle.eEdgeType = (EdgeType)ImplGetI( pElement->nIndexPrecision );
+ aTempEdgeBundle.eEdgeType = static_cast<EdgeType>(ImplGetI( pElement->nIndexPrecision ));
aTempEdgeBundle.nEdgeWidth = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
aTempEdgeBundle.SetColor( ImplGetBitmapColor() );
const bool bUpdateEdgeBundle = aTempEdgeBundle.GetIndex() == pElement->pEdgeBundle->GetIndex();
diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx
index 2f2b57895443..f7a499df0647 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -193,7 +193,7 @@ void CGM::ImplDoClass4()
awt::Size aSize;
awt::Point aPoint( static_cast<long>(aFloatPoint.X), static_cast<long>(aFloatPoint.Y) );
mpOutAct->DrawText( aPoint, aSize,
- reinterpret_cast<char*>(mpSource) + mnParaSize, (FinalFlag)nType );
+ reinterpret_cast<char*>(mpSource) + mnParaSize, static_cast<FinalFlag>(nType) );
mnParaSize = mnElementSize;
}
break;
@@ -231,7 +231,7 @@ void CGM::ImplDoClass4()
awt::Point aPoint( static_cast<long>(aFloatPoint.X), static_cast<long>(aFloatPoint.Y) );
awt::Size aSize(static_cast<long>(dx), static_cast<long>(dy));
mpOutAct->DrawText( aPoint, aSize ,
- reinterpret_cast<char*>(mpSource) + mnParaSize, (FinalFlag)nType );
+ reinterpret_cast<char*>(mpSource) + mnParaSize, static_cast<FinalFlag>(nType) );
mnParaSize = mnElementSize;
}
break;
diff --git a/filter/source/graphicfilter/icgm/class5.cxx b/filter/source/graphicfilter/icgm/class5.cxx
index e78c298842e4..15bd16bf4778 100644
--- a/filter/source/graphicfilter/icgm/class5.cxx
+++ b/filter/source/graphicfilter/icgm/class5.cxx
@@ -33,9 +33,9 @@ void CGM::ImplDoClass5()
case 0x02 : /*Line Type*/
{
if ( pElement->nAspectSourceFlags & ASF_LINETYPE )
- pElement->pLineBundle->eLineType = (LineType)ImplGetI( pElement->nIndexPrecision );
+ pElement->pLineBundle->eLineType = static_cast<LineType>(ImplGetI( pElement->nIndexPrecision ));
else
- pElement->aLineBundle.eLineType = (LineType)ImplGetI( pElement->nIndexPrecision );
+ pElement->aLineBundle.eLineType = static_cast<LineType>(ImplGetI( pElement->nIndexPrecision ));
}
break;
case 0x03 : /*Line Width*/
@@ -72,9 +72,9 @@ void CGM::ImplDoClass5()
case 0x06 : /*Marker Type*/
{
if ( pElement->nAspectSourceFlags & ASF_MARKERTYPE )
- pElement->pMarkerBundle->eMarkerType = (MarkerType)ImplGetI( pElement->nIndexPrecision );
+ pElement->pMarkerBundle->eMarkerType = static_cast<MarkerType>(ImplGetI( pElement->nIndexPrecision ));
else
- pElement->aMarkerBundle.eMarkerType = (MarkerType)ImplGetI( pElement->nIndexPrecision );
+ pElement->aMarkerBundle.eMarkerType = static_cast<MarkerType>(ImplGetI( pElement->nIndexPrecision ));
}
break;
case 0x07 : /*Marker Size*/
@@ -196,8 +196,8 @@ void CGM::ImplDoClass5()
break;
case 0x12 : /*Text Alignment*/
{
- pElement->eTextAlignmentH = (TextAlignmentH)ImplGetUI16();
- pElement->eTextAlignmentV = (TextAlignmentV)ImplGetUI16();
+ pElement->eTextAlignmentH = static_cast<TextAlignmentH>(ImplGetUI16());
+ pElement->eTextAlignmentV = static_cast<TextAlignmentV>(ImplGetUI16());
pElement->nTextAlignmentHCont = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
pElement->nTextAlignmentVCont = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
}
@@ -214,9 +214,9 @@ void CGM::ImplDoClass5()
case 0x16 : /*Fill Interior Style*/
{
if ( pElement->nAspectSourceFlags & ASF_FILLINTERIORSTYLE )
- pElement->pFillBundle->eFillInteriorStyle = (FillInteriorStyle)ImplGetUI16();
+ pElement->pFillBundle->eFillInteriorStyle = static_cast<FillInteriorStyle>(ImplGetUI16());
else
- pElement->aFillBundle.eFillInteriorStyle = (FillInteriorStyle)ImplGetUI16();
+ pElement->aFillBundle.eFillInteriorStyle = static_cast<FillInteriorStyle>(ImplGetUI16());
}
break;
case 0x17 : /*Fill Color*/
@@ -249,9 +249,9 @@ void CGM::ImplDoClass5()
case 0x1b : /*Edge Type*/
{
if ( pElement->nAspectSourceFlags & ASF_EDGETYPE )
- pElement->pEdgeBundle->eEdgeType = (EdgeType)ImplGetI( pElement->nIndexPrecision );
+ pElement->pEdgeBundle->eEdgeType = static_cast<EdgeType>(ImplGetI( pElement->nIndexPrecision ));
else
- pElement->aEdgeBundle.eEdgeType = (EdgeType)ImplGetI( pElement->nIndexPrecision );
+ pElement->aEdgeBundle.eEdgeType = static_cast<EdgeType>(ImplGetI( pElement->nIndexPrecision ));
}
break;
case 0x1c : /*Edge Width*/
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 1e3d9cb8e592..561c98f49ccc 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1367,7 +1367,7 @@ GraphicObject* lclDrawHatch( const drawing::Hatch& rHatch, const Color& rBackCol
pVDev->SetLineColor();
pVDev->SetFillColor(bFillBackground ? rBackColor : Color(COL_TRANSPARENT));
pVDev->DrawRect(rRect);
- pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch((HatchStyle)rHatch.Style, Color(rHatch.Color), rHatch.Distance, static_cast<sal_uInt16>(rHatch.Angle)));
+ pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch(static_cast<HatchStyle>(rHatch.Style), Color(rHatch.Color), rHatch.Distance, static_cast<sal_uInt16>(rHatch.Angle)));
aMtf.Stop();
aMtf.WindStart();
aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
@@ -3961,7 +3961,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
|| pGraphicAttr->IsAdjusted() )
{
SvMemoryStream aSt( sizeof( GraphicAttr ) );
- aSt.WriteUInt16( (sal_uInt16)pGraphicAttr->GetDrawMode() )
+ aSt.WriteUInt16( static_cast<sal_uInt16>(pGraphicAttr->GetDrawMode()) )
.WriteUInt32( static_cast<sal_uInt32>(pGraphicAttr->GetMirrorFlags()) )
.WriteInt32( pGraphicAttr->GetLeftCrop() )
.WriteInt32( pGraphicAttr->GetTopCrop() )
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index e765c3f9fb5e..f840ee3fce62 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -906,7 +906,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
sal_Int32 nLineWidth = static_cast<sal_Int32>(GetPropertyValue( DFF_Prop_lineWidth, 9525 ));
// support LineCap
- const MSO_LineCap eLineCap((MSO_LineCap)GetPropertyValue(DFF_Prop_lineEndCapStyle, mso_lineEndCapSquare));
+ const MSO_LineCap eLineCap(static_cast<MSO_LineCap>(GetPropertyValue(DFF_Prop_lineEndCapStyle, mso_lineEndCapSquare)));
switch(eLineCap)
{
@@ -928,7 +928,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
}
}
- MSO_LineDashing eLineDashing = (MSO_LineDashing)GetPropertyValue( DFF_Prop_lineDashing, mso_lineSolid );
+ MSO_LineDashing eLineDashing = static_cast<MSO_LineDashing>(GetPropertyValue( DFF_Prop_lineDashing, mso_lineSolid ));
if (eLineDashing == mso_lineSolid || nLineWidth < 0)
rSet.Put(XLineStyleItem( drawing::LineStyle_SOLID ) );
else
@@ -1008,7 +1008,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
MSO_LineJoin eLineJointDefault = mso_lineJoinMiter;
if ( eShapeType == mso_sptMin )
eLineJointDefault = mso_lineJoinRound;
- MSO_LineJoin eLineJoint = (MSO_LineJoin)GetPropertyValue( DFF_Prop_lineJoinStyle, eLineJointDefault );
+ MSO_LineJoin eLineJoint = static_cast<MSO_LineJoin>(GetPropertyValue( DFF_Prop_lineJoinStyle, eLineJointDefault ));
css::drawing::LineJoint eXLineJoint( css::drawing::LineJoint_MITER );
if ( eLineJoint == mso_lineJoinBevel )
eXLineJoint = css::drawing::LineJoint_BEVEL;
@@ -1024,9 +1024,9 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
if ( IsProperty( DFF_Prop_lineStartArrowhead ) )
{
- MSO_LineEnd eLineEnd = (MSO_LineEnd)GetPropertyValue( DFF_Prop_lineStartArrowhead, 0 );
- MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineStartArrowWidth, mso_lineMediumWidthArrow );
- MSO_LineEndLength eLength = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineStartArrowLength, mso_lineMediumLenArrow );
+ MSO_LineEnd eLineEnd = static_cast<MSO_LineEnd>(GetPropertyValue( DFF_Prop_lineStartArrowhead, 0 ));
+ MSO_LineEndWidth eWidth = static_cast<MSO_LineEndWidth>(GetPropertyValue( DFF_Prop_lineStartArrowWidth, mso_lineMediumWidthArrow ));
+ MSO_LineEndLength eLength = static_cast<MSO_LineEndLength>(GetPropertyValue( DFF_Prop_lineStartArrowLength, mso_lineMediumLenArrow ));
sal_Int32 nArrowWidth;
bool bArrowCenter;
@@ -1042,9 +1042,9 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
if ( IsProperty( DFF_Prop_lineEndArrowhead ) )
{
- MSO_LineEnd eLineEnd = (MSO_LineEnd)GetPropertyValue( DFF_Prop_lineEndArrowhead, 0 );
- MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineEndArrowWidth, mso_lineMediumWidthArrow );
- MSO_LineEndLength eLength = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineEndArrowLength, mso_lineMediumLenArrow );
+ MSO_LineEnd eLineEnd = static_cast<MSO_LineEnd>(GetPropertyValue( DFF_Prop_lineEndArrowhead, 0 ));
+ MSO_LineEndWidth eWidth = static_cast<MSO_LineEndWidth>(GetPropertyValue( DFF_Prop_lineEndArrowWidth, mso_lineMediumWidthArrow ));
+ MSO_LineEndLength eLength = static_cast<MSO_LineEndLength>(GetPropertyValue( DFF_Prop_lineEndArrowLength, mso_lineMediumLenArrow ));
sal_Int32 nArrowWidth;
bool bArrowCenter;
@@ -1285,7 +1285,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
if ( nFillFlags & 0x10 )
{
- MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
+ MSO_FillType eMSO_FillType = static_cast<MSO_FillType>(GetPropertyValue( DFF_Prop_fillType, mso_fillSolid ));
drawing::FillStyle eXFill = drawing::FillStyle_NONE;
switch( eMSO_FillType )
{
@@ -1430,7 +1430,7 @@ void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
if ( IsProperty( DFF_Prop_txflTextFlow ) )
{
- MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow, 0 ) & 0xFFFF );
+ MSO_TextFlow eTextFlow = static_cast<MSO_TextFlow>( GetPropertyValue( DFF_Prop_txflTextFlow, 0 ) & 0xFFFF );
switch( eTextFlow )
{
case mso_txflTtoBA : /* #68110# */ // Top to Bottom @-font, oben -> unten
@@ -1543,7 +1543,7 @@ void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
rSet.Put( makeSdrTextUpperDistItem( nTextTop ) );
rSet.Put( makeSdrTextLowerDistItem( nTextBottom ) );
- rSet.Put( makeSdrTextWordWrapItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ) );
+ rSet.Put( makeSdrTextWordWrapItem( static_cast<MSO_WrapMode>(GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare )) != mso_wrapNone ) );
rSet.Put( makeSdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape, 0 ) & 2 ) != 0 ) );
}
@@ -1593,7 +1593,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
if ( IsProperty( DFF_Prop_txflTextFlow ) || IsProperty( DFF_Prop_cdirFont ) )
{
sal_Int32 nTextRotateAngle = 0;
- MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow, 0 ) & 0xFFFF );
+ MSO_TextFlow eTextFlow = static_cast<MSO_TextFlow>( GetPropertyValue( DFF_Prop_txflTextFlow, 0 ) & 0xFFFF );
if ( eTextFlow == mso_txflBtoT ) // Bottom to Top non-@
nTextRotateAngle += 90;
@@ -2654,7 +2654,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
nFillFlags &= ~0x10;
if ( nFillFlags & 0x10 )
{
- MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
+ MSO_FillType eMSO_FillType = static_cast<MSO_FillType>(GetPropertyValue( DFF_Prop_fillType, mso_fillSolid ));
switch( eMSO_FillType )
{
case mso_fillSolid :
@@ -3771,7 +3771,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
OUString aLinkFileName, aLinkFilterName;
tools::Rectangle aVisArea;
- MSO_BlipFlags eFlags = (MSO_BlipFlags)GetPropertyValue( DFF_Prop_pibFlags, mso_blipflagDefault );
+ MSO_BlipFlags eFlags = static_cast<MSO_BlipFlags>(GetPropertyValue( DFF_Prop_pibFlags, mso_blipflagDefault ));
sal_uInt32 nBlipId = GetPropertyValue( DFF_Prop_pib, 0 );
bool bGrfRead = false,
@@ -4213,7 +4213,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
rSt.ReadUInt32( aObjData.nShapeId )
.ReadUInt32( temp );
aObjData.nSpFlags = ShapeFlag(temp);
- aObjData.eShapeType = (MSO_SPT)maShapeRecords.Current()->nRecInstance;
+ aObjData.eShapeType = static_cast<MSO_SPT>(maShapeRecords.Current()->nRecInstance);
}
else
{
@@ -4397,7 +4397,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
ReadObjText( aObjectText, pRet );
}
- eGeoTextAlign = ( (MSO_GeoTextAlign)GetPropertyValue( DFF_Prop_gtextAlign, mso_alignTextCenter ) );
+ eGeoTextAlign = static_cast<MSO_GeoTextAlign>(GetPropertyValue( DFF_Prop_gtextAlign, mso_alignTextCenter ));
{
SdrTextHorzAdjust eHorzAdjust;
switch( eGeoTextAlign )
@@ -4743,7 +4743,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
pRet->SetMergedItemSet(aSet);
// connectors
- MSO_ConnectorStyle eConnectorStyle = (MSO_ConnectorStyle)GetPropertyValue( DFF_Prop_cxstyle, mso_cxstyleStraight );
+ MSO_ConnectorStyle eConnectorStyle = static_cast<MSO_ConnectorStyle>(GetPropertyValue( DFF_Prop_cxstyle, mso_cxstyleStraight ));
static_cast<SdrEdgeObj*>(pRet)->ConnectToNode(true, nullptr);
static_cast<SdrEdgeObj*>(pRet)->ConnectToNode(false, nullptr);
@@ -5052,9 +5052,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
pImpRec->nShapeId = rObjData.nShapeId;
pImpRec->eShapeType = rObjData.eShapeType;
- MSO_WrapMode eWrapMode( (MSO_WrapMode)GetPropertyValue(
+ MSO_WrapMode eWrapMode( static_cast<MSO_WrapMode>(GetPropertyValue(
DFF_Prop_WrapText,
- mso_wrapSquare ) );
+ mso_wrapSquare )) );
rObjData.bClientAnchor = maShapeRecords.SeekToContent( rSt,
DFF_msofbtClientAnchor,
SEEK_FROM_CURRENT_AND_RESTART );
@@ -5167,7 +5167,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
bool bVerticalText = false;
if ( IsProperty( DFF_Prop_txflTextFlow ) )
{
- MSO_TextFlow eTextFlow = (MSO_TextFlow)(GetPropertyValue(
+ MSO_TextFlow eTextFlow = static_cast<MSO_TextFlow>(GetPropertyValue(
DFF_Prop_txflTextFlow, 0) & 0xFFFF);
switch( eTextFlow )
{
@@ -5277,8 +5277,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
aSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
}
- switch ( (MSO_WrapMode)
- GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) )
+ switch ( static_cast<MSO_WrapMode>(GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare )) )
{
case mso_wrapNone :
aSet.Put( makeSdrTextAutoGrowWidthItem( true ) );
@@ -5308,7 +5307,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
if ( IsProperty( DFF_Prop_anchorText ) )
{
MSO_Anchor eTextAnchor =
- (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, 0 );
+ static_cast<MSO_Anchor>(GetPropertyValue( DFF_Prop_anchorText, 0 ));
SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_CENTER;
bool bTVASet(false);
@@ -5499,14 +5498,14 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
sal_uInt32 nLineFlags = GetPropertyValue( DFF_Prop_fNoLineDrawDash, 0 );
pImpRec->eLineStyle = (nLineFlags & 8)
- ? (MSO_LineStyle)GetPropertyValue(
+ ? static_cast<MSO_LineStyle>(GetPropertyValue(
DFF_Prop_lineStyle,
- mso_lineSimple )
+ mso_lineSimple ))
: MSO_LineStyle_NONE;
pTextImpRec->eLineStyle = pImpRec->eLineStyle;
- pImpRec->eLineDashing = (MSO_LineDashing)GetPropertyValue(
- DFF_Prop_lineDashing, mso_lineSolid );
+ pImpRec->eLineDashing = static_cast<MSO_LineDashing>(GetPropertyValue(
+ DFF_Prop_lineDashing, mso_lineSolid ));
pTextImpRec->eLineDashing = pImpRec->eLineDashing;
if( pImpRec->nShapeId )
@@ -6101,7 +6100,7 @@ bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
if( ( DFF_msofbtSp == nFbt ) && ( 4 <= nLength ) )
{
// we've found the FSP: note Shape Type and Id!
- eShapeType = (MSO_SPT)nInst;
+ eShapeType = static_cast<MSO_SPT>(nInst);
rSt.ReadUInt32( aInfo.nShapeId );
rSt.SeekRel( nLength - 4 );
nReadSpCont += nLength;
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 8900fd5a60fb..b560fa6f7f71 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -291,7 +291,7 @@ SvStream& ReadPptDocumentAtom(SvStream& rIn, PptDocumentAtom& rAtom)
// clamp dodgy data to avoid overflow in later calculations
rAtom.aNotesPageSize.Width() = std::min<sal_Int32>(nNoticeX, 65536);
rAtom.aNotesPageSize.Height() = std::min<sal_Int32>(nNoticeY, 65536);
- rAtom.eSlidesPageFormat = (PptPageFormat)nSlidePageFormat;
+ rAtom.eSlidesPageFormat = static_cast<PptPageFormat>(nSlidePageFormat);
rAtom.bEmbeddedTrueType = nEmbeddedTrueType;
rAtom.bTitlePlaceholdersOmitted = nTitlePlaceHoldersOmitted;
rAtom.bRightToLeft = nRightToLeft;
@@ -810,7 +810,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
sal_Int32 nTextRotationAngle = 0;
if ( IsProperty( DFF_Prop_txflTextFlow ) )
{
- MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow, 0 ) & 0xFFFF );
+ MSO_TextFlow eTextFlow = static_cast<MSO_TextFlow>( GetPropertyValue( DFF_Prop_txflTextFlow, 0 ) & 0xFFFF );
switch( eTextFlow )
{
case mso_txflBtoT : // Bottom to Top non-@, unten -> oben
@@ -871,7 +871,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
eTHA = SDRTEXTHORZADJUST_CENTER;
// read text anchor
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
+ MSO_Anchor eTextAnchor = static_cast<MSO_Anchor>(GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop ));
switch( eTextAnchor )
{
@@ -926,7 +926,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
eTHA = SDRTEXTHORZADJUST_BLOCK;
// read text anchor
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
+ MSO_Anchor eTextAnchor = static_cast<MSO_Anchor>(GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop ));
switch( eTextAnchor )
{
@@ -998,8 +998,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
rPersistEntry.pPresentationObjects.reset( new sal_uInt32[ PPT_STYLESHEETENTRYS ] );
memset( rPersistEntry.pPresentationObjects.get(), 0, PPT_STYLESHEETENTRYS * 4 );
}
- if ( !rPersistEntry.pPresentationObjects[ (int)nDestinationInstance ] )
- rPersistEntry.pPresentationObjects[ (int)nDestinationInstance ] = rObjData.rSpHd.GetRecBegFilePos();
+ if ( !rPersistEntry.pPresentationObjects[ static_cast<int>(nDestinationInstance) ] )
+ rPersistEntry.pPresentationObjects[ static_cast<int>(nDestinationInstance) ] = rObjData.rSpHd.GetRecBegFilePos();
}
switch ( nDestinationInstance )
{
@@ -1041,7 +1041,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
}
SdrObject* pTObj = nullptr;
- bool bWordWrap = (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone;
+ bool bWordWrap = static_cast<MSO_WrapMode>(GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare )) != mso_wrapNone;
bool bFitShapeToText = ( GetPropertyValue( DFF_Prop_FitTextToShape, 0 ) & 2 ) != 0;
if ( dynamic_cast<const SdrObjCustomShape* >(pRet) != nullptr && ( eTextKind == OBJ_RECT ) )
@@ -1286,7 +1286,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
if ( GetPropertyValue( DFF_Prop_fNoFillHitTest, 0 ) & 0x10 )
{
- if ( (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid ) == mso_fillBackground )
+ if ( static_cast<MSO_FillType>(GetPropertyValue( DFF_Prop_fillType, mso_fillSolid )) == mso_fillBackground )
{
rData.aBackgroundColoredObjects.push_back( pRet );
}
@@ -2609,16 +2609,16 @@ bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal_uIn
switch ( aTextObj.GetInstance() )
{
case TSS_Type::Title :
- nShapePos = rPersist.pPresentationObjects[ (int)TSS_Type::PageTitle ];
+ nShapePos = rPersist.pPresentationObjects[ int(TSS_Type::PageTitle) ];
break;
case TSS_Type::PageTitle :
- nShapePos = rPersist.pPresentationObjects[ (int)TSS_Type::PageTitle ];
+ nShapePos = rPersist.pPresentationObjects[ int(TSS_Type::PageTitle) ];
break;
case TSS_Type::Subtitle :
case TSS_Type::HalfBody :
case TSS_Type::QuarterBody :
case TSS_Type::Body :
- nShapePos = rPersist.pPresentationObjects[ (int)TSS_Type::Body ];
+ nShapePos = rPersist.pPresentationObjects[ int(TSS_Type::Body) ];
break;
default: break;
}
@@ -3327,7 +3327,7 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
while ( ( rSt.GetError() == ERRCODE_NONE ) && ( rSt.Tell() < nHdEndRecPos ) && ( i < nDepth ) )
{
bStyles = true;
- ReadPPTExtParaLevel( rSt, aExtParaSheet[ (TSS_Type)aHd.nRecInstance ].aExtParaLevel[ i++ ] );
+ ReadPPTExtParaLevel( rSt, aExtParaSheet[ static_cast<TSS_Type>(aHd.nRecInstance) ].aExtParaLevel[ i++ ] );
}
#ifdef DBG_UTIL
if ( rSt.Tell() != aHd.GetRecEndFilePos() )
@@ -4157,7 +4157,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
}
while ( ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom ) && ( rIn.Tell() < nEndRecPos ) ) //TODO: aTxMasterStyleHd may be used without having been properly initialized
{
- TSS_Type nInstance = (TSS_Type)aTxMasterStyleHd.nRecInstance;
+ TSS_Type nInstance = static_cast<TSS_Type>(aTxMasterStyleHd.nRecInstance);
if ( ( nInstance <= TSS_Type::LAST ) &&
( ( nInstance != TSS_Type::TextInShape ) || !bFoundTxMasterStyleAtom04 ) )
{
@@ -5648,7 +5648,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, T
Color aDefColor( COL_BLACK );
MSO_FillType eFillType = mso_fillSolid;
if ( rManager.GetPropertyValue( DFF_Prop_fNoFillHitTest, 0 ) & 0x10 )
- eFillType = (MSO_FillType)rManager.GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
+ eFillType = static_cast<MSO_FillType>(rManager.GetPropertyValue( DFF_Prop_fillType, mso_fillSolid ));
else
eFillType = mso_fillBackground;
switch( eFillType )
@@ -6662,7 +6662,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
rIn.ReadUInt16( nTmp ); // this number tells us the TxMasterStyleAtom Instance
if ( nTmp > 8 )
nTmp = 4;
- TSS_Type nInstance = (TSS_Type)nTmp;
+ TSS_Type nInstance = static_cast<TSS_Type>(nTmp);
aTextHd.SeekToEndOfRecord( rIn );
mxImplTextObj->mnInstance = nInstance;
@@ -7719,7 +7719,7 @@ bool SdrPowerPointImport::IsVerticalText() const
bool bVerticalText = false;
if ( IsProperty( DFF_Prop_txflTextFlow ) )
{
- MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow, 0 ) & 0xFFFF );
+ MSO_TextFlow eTextFlow = static_cast<MSO_TextFlow>( GetPropertyValue( DFF_Prop_txflTextFlow, 0 ) & 0xFFFF );
switch( eTextFlow )
{
case mso_txflTtoBA : // Top to Bottom @-font, above -> below
@@ -7750,7 +7750,7 @@ void SdrPowerPointImport::ApplyTextAnchorAttributes( PPTTextObj const & rText
eTHA = SDRTEXTHORZADJUST_CENTER;
// read text anchor
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
+ MSO_Anchor eTextAnchor = static_cast<MSO_Anchor>(GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop ));
switch( eTextAnchor )
{
@@ -7802,7 +7802,7 @@ void SdrPowerPointImport::ApplyTextAnchorAttributes( PPTTextObj const & rText
eTHA = SDRTEXTHORZADJUST_BLOCK;
// read text anchor
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
+ MSO_Anchor eTextAnchor = static_cast<MSO_Anchor>(GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop ));
switch( eTextAnchor )
{
diff --git a/filter/source/pdf/pdfinteract.cxx b/filter/source/pdf/pdfinteract.cxx
index a704fbf3f7ba..8456ecc687ae 100644
--- a/filter/source/pdf/pdfinteract.cxx
+++ b/filter/source/pdf/pdfinteract.cxx
@@ -53,7 +53,7 @@ sal_Bool SAL_CALL PDFInteractionHandler::handleInteractionRequest( const Referen
std::set< vcl::PDFWriter::ErrorCode > aCodes;
sal_Int32 nCodes = aExc.ErrorCodes.getLength();
for( sal_Int32 i = 0; i < nCodes; i++ )
- aCodes.insert( (vcl::PDFWriter::ErrorCode)aExc.ErrorCodes.getConstArray()[i] );
+ aCodes.insert( static_cast<vcl::PDFWriter::ErrorCode>(aExc.ErrorCodes.getConstArray()[i]) );
ScopedVclPtrInstance< ImplErrorDialog > aDlg( aCodes );
aDlg->Execute();
bHandled = true;
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 1187d3391bbf..c1d25b82b1a6 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -220,7 +220,7 @@ public:
{
VariableTextField::elementExport( pSVGExport );
OUString sDateFormat, sTimeFormat;
- SvxDateFormat eDateFormat = (SvxDateFormat)( format & 0x0f );
+ SvxDateFormat eDateFormat = static_cast<SvxDateFormat>( format & 0x0f );
if( eDateFormat != SvxDateFormat::AppDefault )
{
switch( eDateFormat )
@@ -250,7 +250,7 @@ public:
}
}
- SvxTimeFormat eTimeFormat = (SvxTimeFormat)( ( format >> 4 ) & 0x0f );
+ SvxTimeFormat eTimeFormat = static_cast<SvxTimeFormat>( ( format >> 4 ) & 0x0f );
if( eTimeFormat != SvxTimeFormat::AppDefault )
{
switch( eTimeFormat )
@@ -1731,11 +1731,11 @@ bool SVGFilter::implExportShape( const Reference< css::drawing::XShape >& rxShap
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" );
- sal_uInt16 nTextAdjust = (sal_uInt16)ParagraphAdjust_LEFT;
+ sal_uInt16 nTextAdjust = sal_uInt16(ParagraphAdjust_LEFT);
OUString sTextAdjust;
xShapePropSet->getPropertyValue( "ParaAdjust" ) >>= nTextAdjust;
- switch( (ParagraphAdjust)nTextAdjust )
+ switch( static_cast<ParagraphAdjust>(nTextAdjust) )
{
case ParagraphAdjust_LEFT:
sTextAdjust = "left";
@@ -2172,7 +2172,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void )
// we look for the most verbose date format
for( ; aChar != aCharSet.end(); ++aChar )
{
- eCurDateFormat = (SvxDateFormat)( static_cast<int>( *aChar ) & 0x0f );
+ eCurDateFormat = static_cast<SvxDateFormat>( static_cast<int>( *aChar ) & 0x0f );
switch( eDateFormat )
{
case SvxDateFormat::StdSmall:
diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index 163097a99d02..9418323359b9 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -1081,7 +1081,7 @@ bool T602ImportFilterDialog::OptionsDlg()
any = propGet_(xPSetCodeLB, "SelectedItems"); any >>= shr;
if( shr[0] > 0 ) {
- ini.xcode = (tcode)(shr[0]-1);
+ ini.xcode = static_cast<tcode>(shr[0]-1);
ini.forcecode = true;
} else {
ini.forcecode = false;