std::lround is unnecessary here
because we are then casting to a type <=32 bits Change-Id: Ief4a93724ccbae8d697edbd40e4085389d74473f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202156 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -930,7 +930,7 @@ void BGradient::tryToRecreateBorder(basegfx::BColorStops* pAssociatedTransparenc
|
||||
pAssociatedTransparencyStops->removeSpaceAtStart(fOffset);
|
||||
|
||||
// ...and create border value
|
||||
SetBorder(static_cast<sal_uInt16>(std::lround(fOffset * 100.0)));
|
||||
SetBorder(static_cast<sal_uInt16>(std::round(fOffset * 100.0)));
|
||||
}
|
||||
|
||||
if (bIsAxial)
|
||||
|
||||
@@ -71,9 +71,9 @@ namespace
|
||||
|
||||
explicit ColorToBColorConverter(const basegfx::BColor& rBColor)
|
||||
: ColorToBColorConverter(
|
||||
sal_uInt8(std::lround(rBColor.getRed() * 255.0)),
|
||||
sal_uInt8(std::lround(rBColor.getGreen() * 255.0)),
|
||||
sal_uInt8(std::lround(rBColor.getBlue() * 255.0)))
|
||||
sal_uInt8(std::round(rBColor.getRed() * 255.0)),
|
||||
sal_uInt8(std::round(rBColor.getGreen() * 255.0)),
|
||||
sal_uInt8(std::round(rBColor.getBlue() * 255.0)))
|
||||
{}
|
||||
|
||||
basegfx::BColor getBColor() const
|
||||
|
||||
@@ -108,9 +108,9 @@ public:
|
||||
// constructor to create a tools-Color from ::basegfx::BColor
|
||||
explicit Color(const basegfx::BColor& rBColor)
|
||||
: Color(ColorTransparency, 0,
|
||||
sal_uInt8(std::lround(rBColor.getRed() * 255.0)),
|
||||
sal_uInt8(std::lround(rBColor.getGreen() * 255.0)),
|
||||
sal_uInt8(std::lround(rBColor.getBlue() * 255.0)))
|
||||
sal_uInt8(std::round(rBColor.getRed() * 255.0)),
|
||||
sal_uInt8(std::round(rBColor.getGreen() * 255.0)),
|
||||
sal_uInt8(std::round(rBColor.getBlue() * 255.0)))
|
||||
{}
|
||||
|
||||
/** Casts the color to corresponding uInt32.
|
||||
|
||||
@@ -938,7 +938,7 @@ void FontworkHelpers::createCharFillPropsFromShape(
|
||||
if (xPropSetInfo->hasPropertyByName(u"FillTransparence"_ustr)
|
||||
&& (rXPropSet->getPropertyValue(u"FillTransparence"_ustr) >>= nTransPercent))
|
||||
{
|
||||
sal_uInt8 nAlpha = 255 - sal_uInt8(std::lround(double(nTransPercent) * 2.55));
|
||||
sal_uInt8 nAlpha = 255 - sal_uInt8(std::round(double(nTransPercent) * 2.55));
|
||||
aColor.SetAlpha(nAlpha);
|
||||
}
|
||||
rCharPropVec.push_back(comphelper::makePropertyValue(u"CharColor"_ustr, sal_Int32(aColor)));
|
||||
|
||||
@@ -259,9 +259,9 @@ void Color::ApplyTintOrShade(sal_Int16 n100thPercent)
|
||||
aBColor.setBlue(fResult);
|
||||
aBColor = basegfx::utils::hsl2rgb(aBColor);
|
||||
|
||||
R = sal_uInt8(std::lround(aBColor.getRed() * 255.0));
|
||||
G = sal_uInt8(std::lround(aBColor.getGreen() * 255.0));
|
||||
B = sal_uInt8(std::lround(aBColor.getBlue() * 255.0));
|
||||
R = sal_uInt8(std::round(aBColor.getRed() * 255.0));
|
||||
G = sal_uInt8(std::round(aBColor.getGreen() * 255.0));
|
||||
B = sal_uInt8(std::round(aBColor.getBlue() * 255.0));
|
||||
}
|
||||
|
||||
void Color::ApplyLumModOff(sal_Int16 nMod, sal_Int16 nOff)
|
||||
@@ -291,9 +291,9 @@ void Color::ApplyLumModOff(sal_Int16 nMod, sal_Int16 nOff)
|
||||
|
||||
// Switch back to RGB.
|
||||
aBColor = basegfx::utils::hsl2rgb(aBColor);
|
||||
R = sal_uInt8(std::lround(aBColor.getRed() * 255.0));
|
||||
G = sal_uInt8(std::lround(aBColor.getGreen() * 255.0));
|
||||
B = sal_uInt8(std::lround(aBColor.getBlue() * 255.0));
|
||||
R = sal_uInt8(std::round(aBColor.getRed() * 255.0));
|
||||
G = sal_uInt8(std::round(aBColor.getGreen() * 255.0));
|
||||
B = sal_uInt8(std::round(aBColor.getBlue() * 255.0));
|
||||
}
|
||||
|
||||
namespace color
|
||||
|
||||
@@ -239,12 +239,12 @@ void XMLTransGradientStyleExport::exportXML(
|
||||
}
|
||||
|
||||
// Opacity start
|
||||
::sax::Converter::convertPercent(aOut, static_cast<sal_Int32>(std::lround(fOpacityStartPerc)));
|
||||
::sax::Converter::convertPercent(aOut, static_cast<sal_Int32>(std::round(fOpacityStartPerc)));
|
||||
aStrValue = aOut.makeStringAndClear();
|
||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START, aStrValue );
|
||||
|
||||
// Opacity end
|
||||
::sax::Converter::convertPercent( aOut, static_cast<sal_Int32>(std::lround(fOpacityEndPerc)));
|
||||
::sax::Converter::convertPercent( aOut, static_cast<sal_Int32>(std::round(fOpacityEndPerc)));
|
||||
aStrValue = aOut.makeStringAndClear();
|
||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END, aStrValue );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user