summaryrefslogtreecommitdiff
path: root/drawinglayer/source/texture
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:25:28 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:25:28 +0100
commit6e8765b161a1c839fd303eecbd4ddd56f85b86ac (patch)
treefe2114c84b7721ad9bef873d6678435391391d3f /drawinglayer/source/texture
parent54a8e708b4822f6887b5d18af39ccb87387e0774 (diff)
More loplugin:cstylecast: drawinglayer
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I38baea4d1dd354e48eb90fc2fc385ef60485b5e3
Diffstat (limited to 'drawinglayer/source/texture')
-rw-r--r--drawinglayer/source/texture/texture.cxx2
-rw-r--r--drawinglayer/source/texture/texture3d.cxx20
2 files changed, 11 insertions, 11 deletions
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<double>(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<double>(mpReadBitmap->Width()) / maSize.getX();
+ mfMulY = static_cast<double>(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<sal_Int32>((rUV.getX() - maTopLeft.getX()) * mfMulX);
if(rX >= 0 && rX < mpReadBitmap->Width())
{
- rY = (sal_Int32)((rUV.getY() - maTopLeft.getY()) * mfMulY);
+ rY = static_cast<sal_Int32>((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<double>(aBMCol.GetRed()) * fConvertColor,
+ static_cast<double>(aBMCol.GetGreen()) * fConvertColor,
+ static_cast<double>(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<double>(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<double>(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<double>(0xff - aColor.GetLuminance()) * (1.0 / 255.0));
}
}
else