diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:25:28 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:25:28 +0100 |
commit | 6e8765b161a1c839fd303eecbd4ddd56f85b86ac (patch) | |
tree | fe2114c84b7721ad9bef873d6678435391391d3f /drawinglayer/source/tools | |
parent | 54a8e708b4822f6887b5d18af39ccb87387e0774 (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/tools')
-rw-r--r-- | drawinglayer/source/tools/converters.cxx | 6 | ||||
-rw-r--r-- | drawinglayer/source/tools/emfppath.cxx | 2 | ||||
-rw-r--r-- | drawinglayer/source/tools/wmfemfhelper.cxx | 20 |
3 files changed, 14 insertions, 14 deletions
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))); } } |