summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-01-02 21:57:23 +0100
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2017-01-09 23:03:40 +0000
commit5adab0927483d039037b0f93894627e41a2c72f2 (patch)
tree9c3a35c90016091f00654f641322de2ac4c7caca /vcl
parent62a94dcf0c750e335d6ce272d8a5df9813910d5a (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>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/graphicfilter.cxx2
-rw-r--r--vcl/source/gdi/print2.cxx4
-rw-r--r--vcl/source/outdev/transparent.cxx24
3 files changed, 15 insertions, 15 deletions
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!