From 6e8765b161a1c839fd303eecbd4ddd56f85b86ac Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 12 Jan 2018 20:25:28 +0100 Subject: More loplugin:cstylecast: drawinglayer auto-rewrite with "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I38baea4d1dd354e48eb90fc2fc385ef60485b5e3 --- drawinglayer/source/texture/texture.cxx | 2 +- drawinglayer/source/texture/texture3d.cxx | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'drawinglayer/source/texture') diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx index 6a482a73c4cc..cf10feab336d 100644 --- a/drawinglayer/source/texture/texture.cxx +++ b/drawinglayer/source/texture/texture.cxx @@ -623,7 +623,7 @@ namespace drawinglayer for(sal_uInt32 a(1); a < mnSteps; a++) { // create matrix - const double fOffset(mfDistance * (double)a); + const double fOffset(mfDistance * static_cast(a)); basegfx::B2DHomMatrix aNew; aNew.set(1, 2, fOffset); rMatrices.push_back(maTextureTransform * aNew); diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx index 2120b8f04280..9b03362d19e9 100644 --- a/drawinglayer/source/texture/texture3d.cxx +++ b/drawinglayer/source/texture/texture3d.cxx @@ -92,8 +92,8 @@ namespace drawinglayer mpReadTransparence = Bitmap::ScopedReadAccess(maTransparence); } - mfMulX = (double)mpReadBitmap->Width() / maSize.getX(); - mfMulY = (double)mpReadBitmap->Height() / maSize.getY(); + mfMulX = static_cast(mpReadBitmap->Width()) / maSize.getX(); + mfMulY = static_cast(mpReadBitmap->Height()) / maSize.getY(); if(maSize.getX() <= 1.0) { @@ -156,11 +156,11 @@ namespace drawinglayer { if(mpReadBitmap) { - rX = (sal_Int32)((rUV.getX() - maTopLeft.getX()) * mfMulX); + rX = static_cast((rUV.getX() - maTopLeft.getX()) * mfMulX); if(rX >= 0 && rX < mpReadBitmap->Width()) { - rY = (sal_Int32)((rUV.getY() - maTopLeft.getY()) * mfMulY); + rY = static_cast((rUV.getY() - maTopLeft.getY()) * mfMulY); return (rY >= 0 && rY < mpReadBitmap->Height()); } @@ -178,9 +178,9 @@ namespace drawinglayer const double fConvertColor(1.0 / 255.0); const BitmapColor aBMCol(mpReadBitmap->GetColor(nY, nX)); const basegfx::BColor aBSource( - (double)aBMCol.GetRed() * fConvertColor, - (double)aBMCol.GetGreen() * fConvertColor, - (double)aBMCol.GetBlue() * fConvertColor); + static_cast(aBMCol.GetRed()) * fConvertColor, + static_cast(aBMCol.GetGreen()) * fConvertColor, + static_cast(aBMCol.GetBlue()) * fConvertColor); rBColor = aBSource; @@ -189,7 +189,7 @@ namespace drawinglayer // when we have a transparence, make use of it const sal_uInt8 aLuminance(impGetTransparence(nX, nY)); - rfOpacity = ((double)(0xff - aLuminance) * (1.0 / 255.0)); + rfOpacity = (static_cast(0xff - aLuminance) * (1.0 / 255.0)); } else { @@ -212,7 +212,7 @@ namespace drawinglayer { // this texture has an alpha part, use it const sal_uInt8 aLuminance(impGetTransparence(nX, nY)); - const double fNewOpacity((double)(0xff - aLuminance) * (1.0 / 255.0)); + const double fNewOpacity(static_cast(0xff - aLuminance) * (1.0 / 255.0)); rfOpacity = 1.0 - ((1.0 - fNewOpacity) * (1.0 - rfOpacity)); } @@ -222,7 +222,7 @@ namespace drawinglayer const BitmapColor aBMCol(mpReadBitmap->GetColor(nY, nX)); const Color aColor(aBMCol.GetRed(), aBMCol.GetGreen(), aBMCol.GetBlue()); - rfOpacity = ((double)(0xff - aColor.GetLuminance()) * (1.0 / 255.0)); + rfOpacity = (static_cast(0xff - aColor.GetLuminance()) * (1.0 / 255.0)); } } else -- cgit