summaryrefslogtreecommitdiffstats
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
parentMore loplugin:cstylecast: editeng (diff)
downloadcore-6e8765b161a1c839fd303eecbd4ddd56f85b86ac.tar.gz
core-6e8765b161a1c839fd303eecbd4ddd56f85b86ac.zip
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
-rw-r--r--drawinglayer/source/animation/animationtiming.cxx10
-rw-r--r--drawinglayer/source/attribute/sdrlightingattribute3d.cxx2
-rw-r--r--drawinglayer/source/dumper/XShapeDumper.cxx42
-rw-r--r--drawinglayer/source/primitive2d/animatedprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx2
-rw-r--r--drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/gridprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/mediaprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx8
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx4
-rw-r--r--drawinglayer/source/primitive2d/textlineprimitive2d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx8
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx4
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx2
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx26
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx4
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx20
-rw-r--r--drawinglayer/source/texture/texture.cxx2
-rw-r--r--drawinglayer/source/texture/texture3d.cxx20
-rw-r--r--drawinglayer/source/tools/converters.cxx6
-rw-r--r--drawinglayer/source/tools/emfppath.cxx2
-rw-r--r--drawinglayer/source/tools/wmfemfhelper.cxx20
26 files changed, 111 insertions, 111 deletions
diff --git a/drawinglayer/source/animation/animationtiming.cxx b/drawinglayer/source/animation/animationtiming.cxx
index a4204ca2185b..db629aa8d31f 100644
--- a/drawinglayer/source/animation/animationtiming.cxx
+++ b/drawinglayer/source/animation/animationtiming.cxx
@@ -297,14 +297,14 @@ namespace drawinglayer
double AnimationEntryLoop::getDuration() const
{
- return (mfDuration * (double)mnRepeat);
+ return (mfDuration * static_cast<double>(mnRepeat));
}
double AnimationEntryLoop::getStateAtTime(double fTime) const
{
if(mnRepeat && !basegfx::fTools::equalZero(mfDuration))
{
- const sal_uInt32 nCurrentLoop((sal_uInt32)(fTime / mfDuration));
+ const sal_uInt32 nCurrentLoop(static_cast<sal_uInt32>(fTime / mfDuration));
if(nCurrentLoop > mnRepeat)
{
@@ -312,7 +312,7 @@ namespace drawinglayer
}
else
{
- const double fTimeAtLoopStart((double)nCurrentLoop * mfDuration);
+ const double fTimeAtLoopStart(static_cast<double>(nCurrentLoop) * mfDuration);
const double fRelativeTime(fTime - fTimeAtLoopStart);
return AnimationEntryList::getStateAtTime(fRelativeTime);
}
@@ -327,11 +327,11 @@ namespace drawinglayer
if(mnRepeat && !basegfx::fTools::equalZero(mfDuration))
{
- const sal_uInt32 nCurrentLoop((sal_uInt32)(fTime / mfDuration));
+ const sal_uInt32 nCurrentLoop(static_cast<sal_uInt32>(fTime / mfDuration));
if(nCurrentLoop <= mnRepeat)
{
- const double fTimeAtLoopStart((double)nCurrentLoop * mfDuration);
+ const double fTimeAtLoopStart(static_cast<double>(nCurrentLoop) * mfDuration);
const double fRelativeTime(fTime - fTimeAtLoopStart);
const double fNextEventAtLoop(AnimationEntryList::getNextEventTime(fRelativeTime));
diff --git a/drawinglayer/source/attribute/sdrlightingattribute3d.cxx b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
index 0302f129b581..d4ac015c4fb9 100644
--- a/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
@@ -163,7 +163,7 @@ namespace drawinglayer
if(basegfx::fTools::more(fCosFac2, 0.0))
{
- fCosFac2 = pow(fCosFac2, (double)nSpecularIntensity);
+ fCosFac2 = pow(fCosFac2, static_cast<double>(nSpecularIntensity));
aRetval += (rSpecular * fCosFac2);
}
}
diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx
index f39ea1b46d84..cade10e0d5c8 100644
--- a/drawinglayer/source/dumper/XShapeDumper.cxx
+++ b/drawinglayer/source/dumper/XShapeDumper.cxx
@@ -203,7 +203,7 @@ void dumpFillStyleAsAttribute(drawing::FillStyle eFillStyle, xmlTextWriterPtr xm
void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter)
{
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillColor"), "%06x", (unsigned int) aColor);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillColor"), "%06x", static_cast<unsigned int>(aColor));
}
void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter)
@@ -243,15 +243,15 @@ void dumpGradientProperty(const awt::Gradient& rGradient, xmlTextWriterPtr xmlWr
default:
break;
}
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startColor"), "%06x", (unsigned int) rGradient.StartColor);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endColor"), "%06x", (unsigned int) rGradient.EndColor);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.Angle);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("border"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.Border);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("xOffset"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.XOffset);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("yOffset"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.YOffset);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.StartIntensity);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.EndIntensity);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, (sal_Int32) rGradient.StepCount);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startColor"), "%06x", static_cast<unsigned int>(rGradient.StartColor));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endColor"), "%06x", static_cast<unsigned int>(rGradient.EndColor));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rGradient.Angle));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("border"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rGradient.Border));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("xOffset"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rGradient.XOffset));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("yOffset"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rGradient.YOffset));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("startIntensity"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rGradient.StartIntensity));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("endIntensity"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rGradient.EndIntensity));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("stepCount"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rGradient.StepCount));
}
void dumpFillTransparenceGradientAsElement(const awt::Gradient& rTranspGrad, xmlTextWriterPtr xmlWriter)
@@ -291,9 +291,9 @@ void dumpFillHatchAsElement(const drawing::Hatch& rHatch, xmlTextWriterPtr xmlWr
default:
break;
}
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("color"), "%06x", (unsigned int) rHatch.Color);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) rHatch.Distance);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, (sal_Int32) rHatch.Angle);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("color"), "%06x", static_cast<unsigned int>(rHatch.Color));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rHatch.Distance));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("angle"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rHatch.Angle));
xmlTextWriterEndElement( xmlWriter );
}
@@ -473,11 +473,11 @@ void dumpLineDashAsElement(const drawing::LineDash& rLineDash, xmlTextWriterPtr
default:
break;
}
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dots"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.Dots);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dotLen"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.DotLen);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashes"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.Dashes);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashLen"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.DashLen);
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, (sal_Int32) rLineDash.Distance);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dots"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rLineDash.Dots));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dotLen"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rLineDash.DotLen));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashes"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rLineDash.Dashes));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("dashLen"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rLineDash.DashLen));
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("distance"), "%" SAL_PRIdINT32, static_cast<sal_Int32>(rLineDash.Distance));
xmlTextWriterEndElement( xmlWriter );
}
@@ -489,7 +489,7 @@ void dumpLineDashNameAsAttribute(const OUString& sLineDashName, xmlTextWriterPtr
void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter)
{
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineColor"), "%06x", (unsigned int) aLineColor);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineColor"), "%06x", static_cast<unsigned int>(aLineColor));
}
void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter)
@@ -695,7 +695,7 @@ void dumpCharHeightAsAttribute(float fHeight, xmlTextWriterPtr xmlWriter)
void dumpCharColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter)
{
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fontColor"), "%06x", (unsigned int) aColor);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fontColor"), "%06x", static_cast<unsigned int>(aColor));
}
@@ -945,7 +945,7 @@ void dumpShadowAsAttribute(bool bShadow, xmlTextWriterPtr xmlWriter)
void dumpShadowColorAsAttribute(sal_Int32 aShadowColor, xmlTextWriterPtr xmlWriter)
{
- xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowColor"), "%06x", (unsigned int) aShadowColor);
+ xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("shadowColor"), "%06x", static_cast<unsigned int>(aShadowColor));
}
void dumpShadowTransparenceAsAttribute(sal_Int32 aShadowTransparence, xmlTextWriterPtr xmlWriter)
diff --git a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
index 5808b68e0374..3050d90a6a55 100644
--- a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
@@ -70,7 +70,7 @@ namespace drawinglayer
{
const double fState(getAnimationEntry().getStateAtTime(rViewInformation.getViewTime()));
const sal_uInt32 nLen(getChildren().size());
- sal_uInt32 nIndex(basegfx::fround(fState * (double)nLen));
+ sal_uInt32 nIndex(basegfx::fround(fState * static_cast<double>(nLen)));
if(nIndex >= nLen)
{
@@ -158,9 +158,9 @@ namespace drawinglayer
fState = 1.0;
}
- const double fIndex(fState * (double)(nSize - 1));
+ const double fIndex(fState * static_cast<double>(nSize - 1));
const sal_uInt32 nIndA(sal_uInt32(floor(fIndex)));
- const double fOffset(fIndex - (double)nIndA);
+ const double fOffset(fIndex - static_cast<double>(nIndA));
basegfx::B2DHomMatrix aTargetTransform;
std::vector< basegfx::utils::B2DHomMatrixBufferedDecompose >::const_iterator aMatA(maMatrixStack.begin() + nIndA);
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index f718ceef5511..b6a65c68c980 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -177,7 +177,7 @@ namespace drawinglayer
aScreenZoom *= fZoomScale;
// set zoom at control view for text scaling
- xControlView->setZoom((float)aScreenZoom.getX(), (float)aScreenZoom.getY());
+ xControlView->setZoom(static_cast<float>(aScreenZoom.getX()), static_cast<float>(aScreenZoom.getY()));
}
}
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index ce178aec61be..77e53a42cdc1 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -51,9 +51,9 @@ namespace drawinglayer
{
const double fDiscreteDistance(getFillHatch().getDistance() / getDiscreteUnit());
- if(fDiscreteDistance < (double)getFillHatch().getMinimalDiscreteDistance())
+ if(fDiscreteDistance < static_cast<double>(getFillHatch().getMinimalDiscreteDistance()))
{
- fDistance = (double)getFillHatch().getMinimalDiscreteDistance() * getDiscreteUnit();
+ fDistance = static_cast<double>(getFillHatch().getMinimalDiscreteDistance()) * getDiscreteUnit();
}
}
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index ba0a4705be00..2d9f1612b1f0 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -143,7 +143,7 @@ namespace drawinglayer
for (sal_uInt32 a(0); a < nCount; a++)
{
const sal_uInt32 aStepTime(generateStepTime(a));
- const animation::AnimationEntryFixed aTime((double)aStepTime, (double)a / (double)nCount);
+ const animation::AnimationEntryFixed aTime(static_cast<double>(aStepTime), static_cast<double>(a) / static_cast<double>(nCount));
aAnimationLoop.append(aTime);
}
@@ -366,7 +366,7 @@ namespace drawinglayer
static const sal_uInt64 nAllowedSize(64 * 256 * 256);
static const sal_uInt64 nHugeSize(10000000);
const Size aTarget(maAnimation.GetDisplaySizePixel());
- const sal_uInt64 nUsedSize((sal_uInt64)maAnimation.Count() * aTarget.Width() * aTarget.Height());
+ const sal_uInt64 nUsedSize(static_cast<sal_uInt64>(maAnimation.Count()) * aTarget.Width() * aTarget.Height());
if (nUsedSize < nAllowedSize)
{
@@ -407,7 +407,7 @@ namespace drawinglayer
Primitive2DReference aRetval;
const double fState(getAnimationEntry().getStateAtTime(rViewInformation.getViewTime()));
const sal_uInt32 nLen(maAnimation.Count());
- sal_uInt32 nIndex(basegfx::fround(fState * (double)nLen));
+ sal_uInt32 nIndex(basegfx::fround(fState * static_cast<double>(nLen)));
// nIndex is the requested frame - it is in range [0..nLen[
// create frame representation in VirtualDevices
diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
index 877374e549ef..41d6787ad1ed 100644
--- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
@@ -104,7 +104,7 @@ namespace drawinglayer
fSmallStepX *= 2.0;
}
- nSmallStepsX = (sal_uInt32)(fStepX / fSmallStepX);
+ nSmallStepsX = static_cast<sal_uInt32>(fStepX / fSmallStepX);
}
if(getSubdivisionsY())
@@ -115,7 +115,7 @@ namespace drawinglayer
fSmallStepY *= 2.0;
}
- nSmallStepsY = (sal_uInt32)(fStepY / fSmallStepY);
+ nSmallStepsY = static_cast<sal_uInt32>(fStepY / fSmallStepY);
}
// calculate extended viewport in which grid points may lie at all
diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
index fc9a7270afab..9f95f62ca7e7 100644
--- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
@@ -58,7 +58,7 @@ namespace drawinglayer
if(getDiscreteBorder())
{
const basegfx::B2DVector aDiscreteInLogic(rViewInformation.getInverseObjectToViewTransformation() *
- basegfx::B2DVector((double)getDiscreteBorder(), (double)getDiscreteBorder()));
+ basegfx::B2DVector(static_cast<double>(getDiscreteBorder()), static_cast<double>(getDiscreteBorder())));
const double fDiscreteSize(aDiscreteInLogic.getX() + aDiscreteInLogic.getY());
basegfx::B2DRange aSourceRange(0.0, 0.0, 1.0, 1.0);
@@ -130,7 +130,7 @@ namespace drawinglayer
if(getDiscreteBorder())
{
const basegfx::B2DVector aDiscreteInLogic(rViewInformation.getInverseObjectToViewTransformation() *
- basegfx::B2DVector((double)getDiscreteBorder(), (double)getDiscreteBorder()));
+ basegfx::B2DVector(static_cast<double>(getDiscreteBorder()), static_cast<double>(getDiscreteBorder())));
const double fDiscreteSize(aDiscreteInLogic.getX() + aDiscreteInLogic.getY());
aRetval.grow(-0.5 * fDiscreteSize);
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index d4fd9c0c5e94..13a81abbaf19 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -90,10 +90,10 @@ namespace
if(nOpacity)
{
pContent->SetPixel(y, x, BitmapColor(
- (sal_uInt8)(nRed / nDivisor),
- (sal_uInt8)(nGreen / nDivisor),
- (sal_uInt8)(nBlue / nDivisor)));
- pAlpha->SetPixel(y, x, BitmapColor(255 - (sal_uInt8)nOpacity));
+ static_cast<sal_uInt8>(nRed / nDivisor),
+ static_cast<sal_uInt8>(nGreen / nDivisor),
+ static_cast<sal_uInt8>(nBlue / nDivisor)));
+ pAlpha->SetPixel(y, x, BitmapColor(255 - static_cast<sal_uInt8>(nOpacity)));
}
}
}
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 820f0f9dbe4c..bfc9140e8d7c 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -426,7 +426,7 @@ namespace drawinglayer
// handle FontRotation (if defined)
if(!basegfx::fTools::equalZero(fFontRotation))
{
- sal_Int16 aRotate10th((sal_Int16)(fFontRotation * (-1800.0/F_PI)));
+ sal_Int16 aRotate10th(static_cast<sal_Int16>(fFontRotation * (-1800.0/F_PI)));
aRetval.SetOrientation(aRotate10th % 3600);
}
@@ -481,7 +481,7 @@ namespace drawinglayer
// means the scaling is in the direct relation of width to height
if(rFont.GetFontSize().getWidth() > 0)
{
- o_rSize.setX((double)rFont.GetFontSize().getWidth());
+ o_rSize.setX(static_cast<double>(rFont.GetFontSize().getWidth()));
}
#endif
return aRetval;
diff --git a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx
index 89d1b92afec6..749ab200711e 100644
--- a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx
@@ -175,7 +175,7 @@ namespace drawinglayer
for(const int* p = pDotDashArray; *p; ++p)
{
- aDoubleArray.push_back((double)(*p) * fHeight);
+ aDoubleArray.push_back(static_cast<double>(*p) * fHeight);
}
aStrokeAttribute = attribute::StrokeAttribute(aDoubleArray);
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index fb6555fd4e05..6c6f3eb407b5 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -72,7 +72,7 @@ namespace drawinglayer
basegfx::B3DPoint aLastLeft(0.0, 1.0, 0.0);
basegfx::B3DPoint aLastRight(1.0, 1.0, 0.0);
basegfx::B3DHomMatrix aRot;
- aRot.rotate(F_2PI / (double)m_nLineTubeSegments, 0.0, 0.0);
+ aRot.rotate(F_2PI / static_cast<double>(m_nLineTubeSegments), 0.0, 0.0);
m_aLineTubeList.resize(m_nLineTubeSegments);
for(sal_uInt32 a = 0; a < m_nLineTubeSegments; ++a)
@@ -154,7 +154,7 @@ namespace drawinglayer
const basegfx::B3DPoint aNull(0.0, 0.0, 0.0);
basegfx::B3DPoint aLast(0.0, 1.0, 0.0);
basegfx::B3DHomMatrix aRot;
- aRot.rotate(F_2PI / (double)m_nLineCapSegments, 0.0, 0.0);
+ aRot.rotate(F_2PI / static_cast<double>(m_nLineCapSegments), 0.0, 0.0);
m_aLineCapList.resize(m_nLineCapSegments);
for(sal_uInt32 a = 0; a < m_nLineCapSegments; ++a)
@@ -309,7 +309,7 @@ namespace drawinglayer
if(basegfx::B2DLineJoin::Round == aLineJoin)
{
// calculate new horizontal segments
- const sal_uInt32 nHorSeg(basegfx::fround((fAngle / F_2PI) * (double)nSegments));
+ const sal_uInt32 nHorSeg(basegfx::fround((fAngle / F_2PI) * static_cast<double>(nSegments)));
if(nHorSeg)
{
@@ -345,7 +345,7 @@ namespace drawinglayer
}
}
- const double fInc(F_PI / (double)nVerSeg);
+ const double fInc(F_PI / static_cast<double>(nVerSeg));
const double fSin(sin(-fAngle));
const double fCos(cos(-fAngle));
const bool bMiter(basegfx::B2DLineJoin::Miter == aLineJoin);
diff --git a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
index 9f740ee742e0..612dd4254802 100644
--- a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
@@ -425,11 +425,11 @@ namespace drawinglayer
}
// create segments (a + 1 .. nSteps)
- const double fStepSize(1.0 / (double)nSteps);
+ const double fStepSize(1.0 / static_cast<double>(nSteps));
for(sal_uInt32 a(0); a < nSteps; a++)
{
- const double fStep((double)(a + 1) * fStepSize);
+ const double fStep(static_cast<double>(a + 1) * fStepSize);
basegfx::B2DPolyPolygon aNewPoly(bBackScale ? basegfx::utils::interpolate(aFront, aBack, fStep) : aFront);
basegfx::B3DHomMatrix aNewMat;
aNewMat.rotate(0.0, fRotation * fStep, 0.0);
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index 22120e40f10c..cf00f208b9b8 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -62,7 +62,7 @@ namespace drawinglayer
const double fFrontArea(basegfx::utils::getArea(aFirstPolygon));
const double fSqrtFrontArea(sqrt(fFrontArea));
double fRelativeTextureWidth = basegfx::fTools::equalZero(fSqrtFrontArea) ? 1.0 : fFrontLength / fSqrtFrontArea;
- fRelativeTextureWidth = (double)((sal_uInt32)(fRelativeTextureWidth - 0.5));
+ fRelativeTextureWidth = static_cast<double>(static_cast<sal_uInt32>(fRelativeTextureWidth - 0.5));
if(fRelativeTextureWidth < 1.0)
{
diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
index 396cf22c0e7f..449304d381a0 100644
--- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
@@ -87,7 +87,7 @@ namespace drawinglayer
// different from forced to sphere texture coordinates,
// create a old version from it by rotating to old state before applying
// the texture coordinates to emulate old behaviour
- fRelativeAngle = F_2PI * ((double)((getHorizontalSegments() >> 1) - 1) / (double)getHorizontalSegments());
+ fRelativeAngle = F_2PI * (static_cast<double>((getHorizontalSegments() >> 1) - 1) / static_cast<double>(getHorizontalSegments()));
basegfx::B3DHomMatrix aRot;
aRot.rotate(0.0, fRelativeAngle, 0.0);
aFill.transform(aRot);
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 1b3382243a3d..c5f806c5bb0b 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -259,8 +259,8 @@ namespace drawinglayer
basegfx::B2DRange aRangePixel(rRange);
aRangePixel.transform(mrOutDev.GetViewTransformation());
const ::tools::Rectangle aRectPixel(
- (sal_Int32)floor(aRangePixel.getMinX()), (sal_Int32)floor(aRangePixel.getMinY()),
- (sal_Int32)ceil(aRangePixel.getMaxX()), (sal_Int32)ceil(aRangePixel.getMaxY()));
+ static_cast<sal_Int32>(floor(aRangePixel.getMinX())), static_cast<sal_Int32>(floor(aRangePixel.getMinY())),
+ static_cast<sal_Int32>(ceil(aRangePixel.getMaxX())), static_cast<sal_Int32>(ceil(aRangePixel.getMaxY())));
const Point aEmptyPoint;
maDestPixel = ::tools::Rectangle(aEmptyPoint, mrOutDev.GetOutputSizePixel());
maDestPixel.Intersection(aRectPixel);
@@ -396,7 +396,7 @@ namespace drawinglayer
}
else if(0.0 != fTrans)
{
- sal_uInt8 nMaskValue((sal_uInt8)basegfx::fround(fTrans * 255.0));
+ sal_uInt8 nMaskValue(static_cast<sal_uInt8>(basegfx::fround(fTrans * 255.0)));
const AlphaMask aAlphaMask(aSizePixel, &nMaskValue);
mrOutDev.DrawBitmapEx(maDestPixel.TopLeft(), BitmapEx(aContent, aAlphaMask));
}
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index eb984b5d9c65..72710f9fbf84 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -902,8 +902,8 @@ namespace drawinglayer
// still need to fill in the location (is a class Rectangle)
const basegfx::B2DRange aRangeLogic(rControlPrimitive.getB2DRange(getViewInformation2D()));
const ::tools::Rectangle aRectLogic(
- (sal_Int32)floor(aRangeLogic.getMinX()), (sal_Int32)floor(aRangeLogic.getMinY()),
- (sal_Int32)ceil(aRangeLogic.getMaxX()), (sal_Int32)ceil(aRangeLogic.getMaxY()));
+ static_cast<sal_Int32>(floor(aRangeLogic.getMinX())), static_cast<sal_Int32>(floor(aRangeLogic.getMinY())),
+ static_cast<sal_Int32>(ceil(aRangeLogic.getMaxX())), static_cast<sal_Int32>(ceil(aRangeLogic.getMaxY())));
pPDFControl->Location = aRectLogic;
Size aFontSize(pPDFControl->TextFont.GetFontSize());
@@ -1017,8 +1017,8 @@ namespace drawinglayer
// emulate data handling from ImpEditEngine::Paint
const basegfx::B2DRange aViewRange(rContent.getB2DRange(getViewInformation2D()));
const ::tools::Rectangle aRectLogic(
- (sal_Int32)floor(aViewRange.getMinX()), (sal_Int32)floor(aViewRange.getMinY()),
- (sal_Int32)ceil(aViewRange.getMaxX()), (sal_Int32)ceil(aViewRange.getMaxY()));
+ static_cast<sal_Int32>(floor(aViewRange.getMinX())), static_cast<sal_Int32>(floor(aViewRange.getMinY())),
+ static_cast<sal_Int32>(ceil(aViewRange.getMaxX())), static_cast<sal_Int32>(ceil(aViewRange.getMaxY())));
vcl::PDFExtOutDevBookmarkEntry aBookmark;
aBookmark.nLinkId = mpPDFExtOutDevData->CreateLink(aRectLogic);
aBookmark.aBookmark = aURL;
@@ -1861,7 +1861,7 @@ namespace drawinglayer
}
// set line and fill color
- const sal_uInt16 nTransPercentVcl((sal_uInt16)basegfx::fround(rUniTransparenceCandidate.getTransparence() * 100.0));
+ const sal_uInt16 nTransPercentVcl(static_cast<sal_uInt16>(basegfx::fround(rUniTransparenceCandidate.getTransparence() * 100.0)));
mpOutputDevice->SetFillColor(Color(aPolygonColor));
mpOutputDevice->SetLineColor();
@@ -1900,7 +1900,7 @@ namespace drawinglayer
// create uniform VCL gradient for uniform transparency
Gradient aVCLGradient;
- const sal_uInt8 nTransPercentVcl((sal_uInt8)basegfx::fround(rUniTransparenceCandidate.getTransparence() * 255.0));
+ const sal_uInt8 nTransPercentVcl(static_cast<sal_uInt8>(basegfx::fround(rUniTransparenceCandidate.getTransparence() * 255.0)));
const Color aTransColor(nTransPercentVcl, nTransPercentVcl, nTransPercentVcl);
aVCLGradient.SetStyle(GradientStyle::Linear);
@@ -1984,8 +1984,8 @@ namespace drawinglayer
basegfx::B2DRange aViewRange(rContent.getB2DRange(getViewInformation2D()));
aViewRange.transform(maCurrentTransformation);
const ::tools::Rectangle aRectLogic(
- (sal_Int32)floor(aViewRange.getMinX()), (sal_Int32)floor(aViewRange.getMinY()),
- (sal_Int32)ceil(aViewRange.getMaxX()), (sal_Int32)ceil(aViewRange.getMaxY()));
+ static_cast<sal_Int32>(floor(aViewRange.getMinX())), static_cast<sal_Int32>(floor(aViewRange.getMinY())),
+ static_cast<sal_Int32>(ceil(aViewRange.getMaxX())), static_cast<sal_Int32>(ceil(aViewRange.getMaxY())));
const ::tools::Rectangle aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic));
Size aSizePixel(aRectPixel.GetSize());
const Point aEmptyPoint;
@@ -1997,9 +1997,9 @@ namespace drawinglayer
if(nViewVisibleArea > nMaxQuadratPixels)
{
// reduce render size
- fReduceFactor = sqrt((double)nMaxQuadratPixels / (double)nViewVisibleArea);
- aSizePixel = Size(basegfx::fround((double)aSizePixel.getWidth() * fReduceFactor),
- basegfx::fround((double)aSizePixel.getHeight() * fReduceFactor));
+ fReduceFactor = sqrt(double(nMaxQuadratPixels) / static_cast<double>(nViewVisibleArea));
+ aSizePixel = Size(basegfx::fround(static_cast<double>(aSizePixel.getWidth()) * fReduceFactor),
+ basegfx::fround(static_cast<double>(aSizePixel.getHeight()) * fReduceFactor));
}
if(aBufferDevice->SetOutputSizePixel(aSizePixel))
@@ -2016,8 +2016,8 @@ namespace drawinglayer
basegfx::B2DHomMatrix aViewTransform(aBufferDevice->GetViewTransformation());
const Size aDPIOld(mpOutputDevice->LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch)));
const Size aDPINew(aBufferDevice->LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch)));
- const double fDPIXChange((double)aDPIOld.getWidth() / (double)aDPINew.getWidth());
- const double fDPIYChange((double)aDPIOld.getHeight() / (double)aDPINew.getHeight());
+ const double fDPIXChange(static_cast<double>(aDPIOld.getWidth()) / static_cast<double>(aDPINew.getWidth()));
+ const double fDPIYChange(static_cast<double>(aDPIOld.getHeight()) / static_cast<double>(aDPINew.getHeight()));
if(!basegfx::fTools::equal(fDPIXChange, 1.0) || !basegfx::fTools::equal(fDPIYChange, 1.0))
{
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 5c5c0bb93b34..11b40ce4d56b 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -801,7 +801,7 @@ namespace drawinglayer
// create hatch
const basegfx::B2DVector aDiscreteDistance(maCurrentTransformation * basegfx::B2DVector(rFillHatchAttributes.getDistance(), 0.0));
const sal_uInt32 nDistance(basegfx::fround(aDiscreteDistance.getLength()));
- const sal_uInt16 nAngle10((sal_uInt16)basegfx::fround(rFillHatchAttributes.getAngle() / F_PI1800));
+ const sal_uInt16 nAngle10(static_cast<sal_uInt16>(basegfx::fround(rFillHatchAttributes.getAngle() / F_PI1800)));
::Hatch aVCLHatch(eHatchStyle, Color(rFillHatchAttributes.getColor()), nDistance, nAngle10);
// draw hatch using VCL
@@ -828,8 +828,8 @@ namespace drawinglayer
// create rectangle for fill
const basegfx::B2DRange& aViewport(getViewInformation2D().getDiscreteViewport());
const ::tools::Rectangle aRectangle(
- (sal_Int32)floor(aViewport.getMinX()), (sal_Int32)floor(aViewport.getMinY()),
- (sal_Int32)ceil(aViewport.getMaxX()), (sal_Int32)ceil(aViewport.getMaxY()));
+ static_cast<sal_Int32>(floor(aViewport.getMinX())), static_cast<sal_Int32>(floor(aViewport.getMinY())),
+ static_cast<sal_Int32>(ceil(aViewport.getMaxX())), static_cast<sal_Int32>(ceil(aViewport.getMaxY())));
mpOutputDevice->DrawRect(aRectangle);
// restore AA setting
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 0240cd988dad..40409e15dac7 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -1178,8 +1178,8 @@ namespace drawinglayer
if(!aRange.isEmpty())
{
const ::tools::Rectangle aRectangle(
- (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()),
- (sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY()));
+ static_cast<sal_Int32>(floor(aRange.getMinX())), static_cast<sal_Int32>(floor(aRange.getMinY())),
+ static_cast<sal_Int32>(ceil(aRange.getMaxX())), static_cast<sal_Int32>(ceil(aRange.getMaxY())));
if(!aRectangle.IsEmpty())
{
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index af2b31e399fb..ba12a85ecf12 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -277,10 +277,10 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi
{
if(!(nSpanCount & 0x0001))
{
- if(nLine >= 0 && nLine < (sal_Int32)mrBuffer.getHeight())
+ if(nLine >= 0 && nLine < static_cast<sal_Int32>(mrBuffer.getHeight()))
{
- sal_uInt32 nXA(std::min(mrBuffer.getWidth(), (sal_uInt32)std::max((sal_Int32)0, basegfx::fround(rA.getX().getVal()))));
- const sal_uInt32 nXB(std::min(mrBuffer.getWidth(), (sal_uInt32)std::max((sal_Int32)0, basegfx::fround(rB.getX().getVal()))));
+ sal_uInt32 nXA(std::min(mrBuffer.getWidth(), static_cast<sal_uInt32>(std::max(sal_Int32(0), basegfx::fround(rA.getX().getVal())))));
+ const sal_uInt32 nXB(std::min(mrBuffer.getWidth(), static_cast<sal_uInt32>(std::max(sal_Int32(0), basegfx::fround(rB.getX().getVal())))));
if(nXA < nXB)
{
@@ -299,14 +299,14 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi
while(nXA < nXB)
{
// early-test Z values if we need to do anything at all
- const double fNewZ(std::max(0.0, std::min((double)0xffff, maIntZ.getVal())));
+ const double fNewZ(std::max(0.0, std::min(double(0xffff), maIntZ.getVal())));
const sal_uInt16 nNewZ(static_cast< sal_uInt16 >(fNewZ));
sal_uInt16& rOldZ(mrBuffer.getZ(nScanlineIndex));
if(nNewZ > rOldZ)
{
// detect color and opacity for this pixel
- const sal_uInt16 nOpacity(std::max((sal_Int16)0, static_cast< sal_Int16 >(decideColorAndOpacity(aNewColor) * 255.0)));
+ const sal_uInt16 nOpacity(std::max(sal_Int16(0), static_cast< sal_Int16 >(decideColorAndOpacity(aNewColor) * 255.0)));
if(nOpacity > 0)
{
@@ -328,21 +328,21 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi
// mix new color by using
// color' = color * (1 - opacity) + newcolor * opacity
const sal_uInt16 nTransparence(0x0100 - nOpacity);
- rDest.setRed((sal_uInt8)(((rDest.getRed() * nTransparence) + ((sal_uInt16)(255.0 * aNewColor.getRed()) * nOpacity)) >> 8));
- rDest.setGreen((sal_uInt8)(((rDest.getGreen() * nTransparence) + ((sal_uInt16)(255.0 * aNewColor.getGreen()) * nOpacity)) >> 8));
- rDest.setBlue((sal_uInt8)(((rDest.getBlue() * nTransparence) + ((sal_uInt16)(255.0 * aNewColor.getBlue()) * nOpacity)) >> 8));
+ rDest.setRed(static_cast<sal_uInt8>(((rDest.getRed() * nTransparence) + (static_cast<sal_uInt16>(255.0 * aNewColor.getRed()) * nOpacity)) >> 8));
+ rDest.setGreen(static_cast<sal_uInt8>(((rDest.getGreen() * nTransparence) + (static_cast<sal_uInt16>(255.0 * aNewColor.getGreen()) * nOpacity)) >> 8));
+ rDest.setBlue(static_cast<sal_uInt8>(((rDest.getBlue() * nTransparence) + (static_cast<sal_uInt16>(255.0 * aNewColor.getBlue()) * nOpacity)) >> 8));
if(0xff != rDest.getOpacity())
{
// both are transparent, mix new opacity by using
// opacity = newopacity * (1 - oldopacity) + oldopacity
- rDest.setOpacity(((sal_uInt8)((nOpacity * (0x0100 - rDest.getOpacity())) >> 8)) + rDest.getOpacity());
+ rDest.setOpacity(static_cast<sal_uInt8>((nOpacity * (0x0100 - rDest.getOpacity())) >> 8) + rDest.getOpacity());
}
}
else
{
// dest is unused, set color
- rDest = basegfx::BPixel(aNewColor, (sal_uInt8)nOpacity);
+ rDest = basegfx::BPixel(aNewColor, static_cast<sal_uInt8>(nOpacity));
}
}
}
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
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index 41f861bb0172..cb14d9dbb567 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -53,9 +53,9 @@ namespace drawinglayer
if(nViewVisibleArea > nMaxQuadratPixels)
{
// reduce render size
- double fReduceFactor = sqrt((double)nMaxQuadratPixels / (double)nViewVisibleArea);
- nDiscreteWidth = basegfx::fround((double)nDiscreteWidth * fReduceFactor);
- nDiscreteHeight = basegfx::fround((double)nDiscreteHeight * fReduceFactor);
+ double fReduceFactor = sqrt(static_cast<double>(nMaxQuadratPixels) / static_cast<double>(nViewVisibleArea));
+ nDiscreteWidth = basegfx::fround(static_cast<double>(nDiscreteWidth) * fReduceFactor);
+ nDiscreteHeight = basegfx::fround(static_cast<double>(nDiscreteHeight) * fReduceFactor);
const drawinglayer::primitive2d::Primitive2DReference aEmbed(
new drawinglayer::primitive2d::TransformPrimitive2D(
diff --git a/drawinglayer/source/tools/emfppath.cxx b/drawinglayer/source/tools/emfppath.cxx
index 8e0d2b159a20..ec9a9e44c328 100644
--- a/drawinglayer/source/tools/emfppath.cxx
+++ b/drawinglayer/source/tools/emfppath.cxx
@@ -76,7 +76,7 @@ namespace emfplushelper
for (int i = 0; i < nPoints; i++)
{
s.ReadUChar(pPointTypes[i]);
- SAL_INFO("drawinglayer", "EMF+\tpoint type: " << (int)pPointTypes[i]);
+ SAL_INFO("drawinglayer", "EMF+\tpoint type: " << static_cast<int>(pPointTypes[i]));
}
}
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index c3a1b4508abd..1f4762472996 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -686,7 +686,7 @@ namespace wmfemfhelper
if(nStartIntens != 100)
{
const basegfx::BColor aBlack;
- aStart = interpolate(aBlack, aStart, (double)nStartIntens * 0.01);
+ aStart = interpolate(aBlack, aStart, static_cast<double>(nStartIntens) * 0.01);
}
const Color aEndColor(rGradient.GetEndColor());
@@ -696,7 +696,7 @@ namespace wmfemfhelper
if(nEndIntens != 100)
{
const basegfx::BColor aBlack;
- aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01);
+ aEnd = interpolate(aBlack, aEnd, static_cast<double>(nEndIntens) * 0.01);
}
drawinglayer::attribute::GradientStyle aGradientStyle(drawinglayer::attribute::GradientStyle::Rect);
@@ -737,10 +737,10 @@ namespace wmfemfhelper
return drawinglayer::attribute::FillGradientAttribute(
aGradientStyle,
- (double)rGradient.GetBorder() * 0.01,
- (double)rGradient.GetOfsX() * 0.01,
- (double)rGradient.GetOfsY() * 0.01,
- (double)rGradient.GetAngle() * F_PI1800,
+ static_cast<double>(rGradient.GetBorder()) * 0.01,
+ static_cast<double>(rGradient.GetOfsX()) * 0.01,
+ static_cast<double>(rGradient.GetOfsY()) * 0.01,
+ static_cast<double>(rGradient.GetAngle()) * F_PI1800,
aStart,
aEnd,
rGradient.GetSteps());
@@ -774,8 +774,8 @@ namespace wmfemfhelper
return drawinglayer::attribute::FillHatchAttribute(
aHatchStyle,
- (double)rHatch.GetDistance(),
- (double)rHatch.GetAngle() * F_PI1800,
+ static_cast<double>(rHatch.GetDistance()),
+ static_cast<double>(rHatch.GetAngle()) * F_PI1800,
rHatch.GetColor().getBColor(),
3, // same default as VCL, a minimum of three discrete units (pixels) offset
false);
@@ -1310,7 +1310,7 @@ namespace wmfemfhelper
TargetHolder& rTarget,
PropertyHolder const & rProperty)
{
- const double fLineWidth(fabs((double)rAction.GetWidth()));
+ const double fLineWidth(fabs(static_cast<double>(rAction.GetWidth())));
if(fLineWidth > 0.0)
{
@@ -1848,7 +1848,7 @@ namespace wmfemfhelper
for(sal_uInt32 a(0); a < nTextLength; a++)
{
- aDXArray.push_back((double)(*(pDXArray + a)));
+ aDXArray.push_back(static_cast<double>(*(pDXArray + a)));
}
}