summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-26 15:28:55 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-26 15:33:30 +0100
commit0eea902d180b7e31119be4674ecb928eaff77593 (patch)
treee7993af77c6c9dd7d26c5a9d0e7db9a49e7b7d53 /filter
parentconst_cast: convert some C-style casts and remove some redundant ones (diff)
downloadcore-0eea902d180b7e31119be4674ecb928eaff77593.tar.gz
core-0eea902d180b7e31119be4674ecb928eaff77593.zip
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Idbae574e5d51d497fea7eadb6d80dec8f97d499a
Diffstat (limited to 'filter')
-rw-r--r--filter/source/flash/swfwriter1.cxx6
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx2
-rw-r--r--filter/source/msfilter/eschesdo.cxx4
-rw-r--r--filter/source/msfilter/msdffimp.cxx4
-rw-r--r--filter/source/msfilter/svdfppt.cxx18
-rw-r--r--filter/source/svg/svgwriter.cxx8
-rw-r--r--filter/source/t602/t602filter.cxx6
7 files changed, 24 insertions, 24 deletions
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index fa4fb921fe70..eec67091f106 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -530,7 +530,7 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon
if( pDXArray )
{
aNormSize = Size( mpVDev->GetTextWidth( rText ), 0 );
- pDX = (long*) pDXArray;
+ pDX = const_cast<long*>(pDXArray);
}
else
{
@@ -1798,7 +1798,7 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf )
case( META_ISECTREGIONCLIPREGION_ACTION ):
case( META_MOVECLIPREGION_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( mpVDev );
+ const_cast<MetaAction*>(pAction)->Execute( mpVDev );
}
break;
@@ -1819,7 +1819,7 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf )
case( META_POP_ACTION ):
case( META_LAYOUTMODE_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( mpVDev );
+ const_cast<MetaAction*>(pAction)->Execute( mpVDev );
}
break;
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index b6ebbb1871d0..165352807024 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -1163,7 +1163,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
const GDIMetaFile aSubstitute( static_cast<const MetaEPSAction*>(pMA)->GetSubstitute() );
bool bLevelConflict = false;
- sal_uInt8* pSource = (sal_uInt8*) aGfxLink.GetData();
+ sal_uInt8* pSource = const_cast<sal_uInt8*>(aGfxLink.GetData());
sal_uLong nSize = aGfxLink.GetDataSize();
sal_uLong nParseThis = POSTSCRIPT_BOUNDINGSEARCH;
if ( nSize < 64 ) // assuming eps is larger than 64 bytes
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 063a2f084a50..30a87f8e8576 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -887,7 +887,7 @@ bool ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
ImplFlushSolverContainer();
mpSdrPage = NULL;
- mXDrawPage = pSvxDrawPage = new SvxFmDrawPage( (SdrPage*) &rPage );
+ mXDrawPage = pSvxDrawPage = new SvxFmDrawPage( const_cast<SdrPage*>(&rPage) );
mXShapes = Reference< XShapes >::query( mXDrawPage );
if ( !mXShapes.is() )
break;
@@ -1041,7 +1041,7 @@ ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx,
{
// why not declare a const parameter if the object will
// not be modified?
- mXShape = uno::Reference< drawing::XShape >::query( ((SdrObject*)&rObj)->getUnoShape() );
+ mXShape = uno::Reference< drawing::XShape >::query( const_cast<SdrObject*>(&rObj)->getUnoShape() );
Init( rEx );
}
}
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 653303dc33ea..2d9997ff5a77 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -220,7 +220,7 @@ void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, sal_uInt32 nOffsDg
{
if ( rManager.SeekToRec( rStCtrl, DFF_msofbtOPT, aRecHd.GetRecEndFilePos() ) )
{
- ( (DffPropertyReader*) this )->pDefaultPropSet = new DffPropSet;
+ const_cast<DffPropertyReader*>(this)->pDefaultPropSet = new DffPropSet;
ReadDffPropSet( rStCtrl, *pDefaultPropSet );
}
}
@@ -249,7 +249,7 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
}
}
- ( (DffPropertyReader*) this )->mnFix16Angle = Fix16ToAngle( GetPropertyValue( DFF_Prop_Rotation, 0 ) );
+ const_cast<DffPropertyReader*>(this)->mnFix16Angle = Fix16ToAngle( GetPropertyValue( DFF_Prop_Rotation, 0 ) );
#ifdef DBG_CUSTOMSHAPE
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index a016b8543400..bc88ae8a723d 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1786,16 +1786,16 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
Graphic aGraphic( rGraf );
- if ( ((SdrPowerPointImport*)this)->maShapeRecords.SeekToContent( rStCtrl, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
+ if ( const_cast<SdrPowerPointImport*>(this)->maShapeRecords.SeekToContent( rStCtrl, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
{
DffRecordHeader aPlaceHd;
while ( ( rStCtrl.GetError() == 0 )
- && ( rStCtrl.Tell() < ((SdrPowerPointImport*)this)->maShapeRecords.Current()->GetRecEndFilePos() ) )
+ && ( rStCtrl.Tell() < const_cast<SdrPowerPointImport*>(this)->maShapeRecords.Current()->GetRecEndFilePos() ) )
{
ReadDffRecordHeader( rStCtrl, aPlaceHd );
if ( aPlaceHd.nRecType == PPT_PST_RecolorInfoAtom )
{
- ((SdrPowerPointImport*)this)->RecolorGraphic( rStCtrl, aPlaceHd.nRecLen, aGraphic );
+ const_cast<SdrPowerPointImport*>(this)->RecolorGraphic( rStCtrl, aPlaceHd.nRecLen, aGraphic );
break;
}
else
@@ -1804,9 +1804,9 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
}
PPTOleEntry* pOe;
- for ( size_t i = 0; i < ((SdrPowerPointImport*)this)->aOleObjectList.size(); ++i )
+ for ( size_t i = 0; i < const_cast<SdrPowerPointImport*>(this)->aOleObjectList.size(); ++i )
{
- pOe = ((SdrPowerPointImport*)this)->aOleObjectList[ i ];
+ pOe = const_cast<SdrPowerPointImport*>(this)->aOleObjectList[ i ];
if ( pOe->nId != (sal_uInt32)nOLEId )
continue;
@@ -2518,7 +2518,7 @@ bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor )
const PptSlidePersistEntry& rE = (*pPageList)[ nAktPageNum ];
nSlideFlags = rE.aSlideAtom.nFlags;
if ( ! ( nSlideFlags & 2 ) )
- ((SdrPowerPointImport*)this)->aPageColors = rE.aColorScheme;
+ const_cast<SdrPowerPointImport*>(this)->aPageColors = rE.aColorScheme;
}
if ( nSlideFlags & 2 ) // follow master colorscheme?
{
@@ -2551,13 +2551,13 @@ bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor )
}
if ( pMasterPersist )
{
- ((SdrPowerPointImport*)this)->aPageColors = pMasterPersist->aColorScheme;
+ const_cast<SdrPowerPointImport*>(this)->aPageColors = pMasterPersist->aColorScheme;
}
}
}
// resgister current color scheme
- ((SdrPowerPointImport*)this)->nPageColorsNum = nAktPageNum;
- ((SdrPowerPointImport*)this)->ePageColorsKind = eAktPageKind;
+ const_cast<SdrPowerPointImport*>(this)->nPageColorsNum = nAktPageNum;
+ const_cast<SdrPowerPointImport*>(this)->ePageColorsKind = eAktPageKind;
}
rColor = aPageColors.GetColor( nNum );
return true;
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 4a394266e065..f48990578f77 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -677,7 +677,7 @@ void SVGTextWriter::setTextProperties( const GDIMetaFile& rMtf, sal_uLong nCurAc
case( META_FONT_ACTION ):
case( META_LAYOUTMODE_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( mpVDev );
+ const_cast<MetaAction*>(pAction)->Execute( mpVDev );
}
break;
@@ -1781,7 +1781,7 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
sal_uLong SVGActionWriter::GetChecksum( const MetaAction* pAction )
{
GDIMetaFile aMtf;
- MetaAction* pA = (MetaAction*)pAction;
+ MetaAction* pA = const_cast<MetaAction*>(pAction);
pA->Duplicate();
aMtf.AddAction( pA );
return aMtf.GetChecksum();
@@ -3522,7 +3522,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
case( META_ISECTREGIONCLIPREGION_ACTION ):
case( META_MOVECLIPREGION_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( mpVDev );
+ const_cast<MetaAction*>(pAction)->Execute( mpVDev );
mbClipAttrChanged = true;
}
break;
@@ -3540,7 +3540,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
case( META_POP_ACTION ):
case( META_LAYOUTMODE_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( mpVDev );
+ const_cast<MetaAction*>(pAction)->Execute( mpVDev );
}
break;
diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index bcaf8984d370..c460dd8523d1 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -508,9 +508,9 @@ void T602ImportFilter::wrtfnt()
const sal_Char *style = "P1";
switch(fst.nowfnt) {
- case standard : style = (char*)(fst.uline ? "T7" : "T1"); break;
- case fat : style = (char*)(fst.uline ? "T8" : "T2"); break;
- case cursive : style = (char*)(fst.uline ? "T9" : "T3"); break;
+ case standard : style = fst.uline ? "T7" : "T1"; break;
+ case fat : style = fst.uline ? "T8" : "T2"; break;
+ case cursive : style = fst.uline ? "T9" : "T3"; break;
case bold : style = "T4"; break;
case tall : style = "T5"; break;
case big : style = "T6"; break;