From 9af8f190ed1bf3f76897ad0c078db16451d6fb69 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 22 Jan 2018 13:11:34 +0100 Subject: More loplugin:cstylecast on Windows Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Ib3355159dd08333e1b7a8d091caf2069cdcc7862 Reviewed-on: https://gerrit.libreoffice.org/48317 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- drawinglayer/source/primitive2d/textlayoutdevice.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drawinglayer/source/primitive2d/textlayoutdevice.cxx') diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index bfc9140e8d7c..66090ad2e34e 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -417,8 +417,8 @@ namespace drawinglayer if(aUnscaledFontMetric.GetAverageFontWidth() > 0) { - const double fScaleFactor((double)nWidth / (double)nHeight); - const sal_uInt32 nScaledWidth(basegfx::fround((double)aUnscaledFontMetric.GetAverageFontWidth() * fScaleFactor)); + const double fScaleFactor(static_cast(nWidth) / static_cast(nHeight)); + const sal_uInt32 nScaledWidth(basegfx::fround(static_cast(aUnscaledFontMetric.GetAverageFontWidth()) * fScaleFactor)); aRetval.SetAverageFontWidth(nScaledWidth); } } @@ -470,7 +470,7 @@ namespace drawinglayer if(aUnscaledFontMetric.GetAverageFontWidth() > 0) { - const double fScaleFactor((double)rFont.GetFontSize().getWidth() / (double)aUnscaledFontMetric.GetAverageFontWidth()); + const double fScaleFactor(static_cast(rFont.GetFontSize().getWidth()) / static_cast(aUnscaledFontMetric.GetAverageFontWidth())); o_rSize.setX(fScaleFactor * o_rSize.getY()); } } -- cgit