diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-01-02 21:57:23 +0100 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-01-09 23:03:40 +0000 |
commit | 5adab0927483d039037b0f93894627e41a2c72f2 (patch) | |
tree | 9c3a35c90016091f00654f641322de2ac4c7caca | |
parent | 62a94dcf0c750e335d6ce272d8a5df9813910d5a (diff) |
replace C-style casts with const_cast
Change-Id: Ica6522b4bfe2aa4517469e89cabe5d4d057cb6b7
Reviewed-on: https://gerrit.libreoffice.org/32657
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 6 | ||||
-rw-r--r-- | svtools/source/misc/transfer.cxx | 2 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 6 | ||||
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print2.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/transparent.cxx | 24 |
6 files changed, 22 insertions, 22 deletions
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 408bee56e2a0..e2608bbe6cb5 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -1622,9 +1622,9 @@ void GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& pOut->Push( PushFlags::CLIPREGION ); pOut->IntersectClipRegion( Rectangle( aOutPt, aOutSz ) ); - ( (GDIMetaFile&) rMtf ).WindStart(); - ( (GDIMetaFile&) rMtf ).Play( pOut, aOutPt, aOutSz ); - ( (GDIMetaFile&) rMtf ).WindStart(); + const_cast<GDIMetaFile&>(rMtf).WindStart(); + const_cast<GDIMetaFile&>(rMtf).Play( pOut, aOutPt, aOutSz ); + const_cast<GDIMetaFile&>(rMtf).WindStart(); pOut->Pop(); } diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index ade1bc011038..08195e6af508 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -690,7 +690,7 @@ bool TransferableHelper::SetGDIMetaFile( const GDIMetaFile& rMtf, const DataFlav { SvMemoryStream aMemStm( 65535, 65535 ); - ( (GDIMetaFile&) rMtf ).Write( aMemStm ); + const_cast<GDIMetaFile&>(rMtf).Write( aMemStm ); maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) ); } diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index e9271fb5ceb3..0212dc95b36b 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -134,7 +134,7 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const OUString& rGraphicId ) { pStm->SetVersion( SOFFICE_FILEFORMAT_8 ); pStm->SetCompressMode( SvStreamCompressFlags::ZBITMAP ); - ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( *pStm ); + const_cast<GDIMetaFile&>( aGraphic.GetGDIMetaFile() ).Write( *pStm ); bRet = ( pStm->GetError() == 0 ); } } @@ -581,7 +581,7 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName, pStream->SetCompressMode( SvStreamCompressFlags::ZBITMAP ); // SJ: first check if this metafile is just a eps file, then we will store the eps instead of svm - GDIMetaFile& rMtf( (GDIMetaFile&)aGraphic.GetGDIMetaFile() ); + GDIMetaFile& rMtf(const_cast<GDIMetaFile&>( aGraphic.GetGDIMetaFile() )); const MetaCommentAction* pComment = ImplCheckForEPS( rMtf ); if ( pComment ) { @@ -706,7 +706,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt else if( aGrfObject.GetType() == GraphicType::GdiMetafile ) { // SJ: first check if this metafile is just a eps file, then we will store the eps instead of svm - GDIMetaFile& rMtf( (GDIMetaFile&)aGraphic.GetGDIMetaFile() ); + GDIMetaFile& rMtf(const_cast<GDIMetaFile&>( aGraphic.GetGDIMetaFile() )); if ( ImplCheckForEPS( rMtf ) ) aExtension = ".eps"; else diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 40c0e1c95830..50506fe955a0 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -2058,7 +2058,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString SvMemoryStream aMemStm( 65535, 65535 ); // #i119735# just use GetGDIMetaFile, it will create a buffered version of contained bitmap now automatically - ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( aMemStm ); + const_cast<GDIMetaFile&>( aGraphic.GetGDIMetaFile() ).Write( aMemStm ); xActiveDataSource->setOutputStream( css::uno::Reference< css::io::XOutputStream >( xStmIf, css::uno::UNO_QUERY ) ); diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index 5ee886c0517b..0e909a01da9d 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -667,9 +667,9 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, if( ! bReduceTransparency || bTransparencyAutoMode ) { // watch for transparent drawing actions - for( pCurrAct = ( (GDIMetaFile&) rInMtf ).FirstAction(); + for( pCurrAct = const_cast<GDIMetaFile&>(rInMtf).FirstAction(); pCurrAct && !bTransparent; - pCurrAct = ( (GDIMetaFile&) rInMtf ).NextAction() ) + pCurrAct = const_cast<GDIMetaFile&>(rInMtf).NextAction() ) { // #i10613# determine if the action is transparency capable diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index e1d8bc5dc67c..a4733434fea4 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -679,9 +679,9 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, if( ( rTransparenceGradient.GetStartColor() == aBlack && rTransparenceGradient.GetEndColor() == aBlack ) || ( mnDrawMode & ( DrawModeFlags::NoTransparency ) ) ) { - ( (GDIMetaFile&) rMtf ).WindStart(); - ( (GDIMetaFile&) rMtf ).Play( this, rPos, rSize ); - ( (GDIMetaFile&) rMtf ).WindStart(); + const_cast<GDIMetaFile&>(rMtf).WindStart(); + const_cast<GDIMetaFile&>(rMtf).Play( this, rPos, rSize ); + const_cast<GDIMetaFile&>(rMtf).WindStart(); } else { @@ -734,9 +734,9 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, // draw MetaFile to buffer xVDev->EnableMapMode(bBufferMapModeEnabled); - ((GDIMetaFile&)rMtf).WindStart(); - ((GDIMetaFile&)rMtf).Play(xVDev.get(), rPos, rSize); - ((GDIMetaFile&)rMtf).WindStart(); + const_cast<GDIMetaFile&>(rMtf).WindStart(); + const_cast<GDIMetaFile&>(rMtf).Play(xVDev.get(), rPos, rSize); + const_cast<GDIMetaFile&>(rMtf).WindStart(); // get content bitmap from buffer xVDev->EnableMapMode(false); @@ -771,9 +771,9 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, const bool bVDevOldMap = xVDev->IsMapModeEnabled(); // create paint bitmap - ( (GDIMetaFile&) rMtf ).WindStart(); - ( (GDIMetaFile&) rMtf ).Play( xVDev.get(), rPos, rSize ); - ( (GDIMetaFile&) rMtf ).WindStart(); + const_cast<GDIMetaFile&>(rMtf).WindStart(); + const_cast<GDIMetaFile&>(rMtf).Play( xVDev.get(), rPos, rSize ); + const_cast<GDIMetaFile&>(rMtf).WindStart(); xVDev->EnableMapMode( false ); aPaint = xVDev->GetBitmap( Point(), xVDev->GetOutputSizePixel() ); xVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( sal_True ) here! @@ -784,9 +784,9 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, xVDev->DrawRect( Rectangle( xVDev->PixelToLogic( Point() ), xVDev->GetOutputSize() ) ); xVDev->SetDrawMode( DrawModeFlags::WhiteLine | DrawModeFlags::WhiteFill | DrawModeFlags::WhiteText | DrawModeFlags::WhiteBitmap | DrawModeFlags::WhiteGradient ); - ( (GDIMetaFile&) rMtf ).WindStart(); - ( (GDIMetaFile&) rMtf ).Play( xVDev.get(), rPos, rSize ); - ( (GDIMetaFile&) rMtf ).WindStart(); + const_cast<GDIMetaFile&>(rMtf).WindStart(); + const_cast<GDIMetaFile&>(rMtf).Play( xVDev.get(), rPos, rSize ); + const_cast<GDIMetaFile&>(rMtf).WindStart(); xVDev->EnableMapMode( false ); aMask = xVDev->GetBitmap( Point(), xVDev->GetOutputSizePixel() ); xVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( sal_True ) here! |