From fda349ab8e834578fbefe9e9407d006eec47c7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 26 May 2024 12:35:19 +0100 Subject: [PATCH] ofz#69246 Integer-overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WTMM takes/returns a double anyway, so just promote earlier Change-Id: I055fa7e7b155abfd15ef51335b34c2e6cfa8a209 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168043 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- hwpfilter/source/hwpreader.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 63b5571b6fe2..2921ef5ff2f0 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -2013,19 +2013,19 @@ void HwpReader::makeDrawStyle( HWPDrawingObject * hdo, FBoxStyle * fstyle) OUString::createFromAscii(ArrowShape[hdo->property.line_tstyle].name) ); if( hdo->property.line_width > 100 ) mxList->addAttribute(u"draw:marker-start-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 3)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 3.0)) + "mm"); else if( hdo->property.line_width > 80 ) mxList->addAttribute(u"draw:marker-start-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 4)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 4.0)) + "mm"); else if( hdo->property.line_width > 60 ) mxList->addAttribute(u"draw:marker-start-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 5)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 5.0)) + "mm"); else if( hdo->property.line_width > 40 ) mxList->addAttribute(u"draw:marker-start-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 6)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 6.0)) + "mm"); else mxList->addAttribute(u"draw:marker-start-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 7)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 7.0)) + "mm"); } if( hdo->property.line_hstyle > 0 && @@ -2035,19 +2035,19 @@ void HwpReader::makeDrawStyle( HWPDrawingObject * hdo, FBoxStyle * fstyle) OUString::createFromAscii(ArrowShape[hdo->property.line_hstyle].name) ); if( hdo->property.line_width > 100 ) mxList->addAttribute(u"draw:marker-end-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 3)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 3.0)) + "mm"); else if( hdo->property.line_width > 80 ) mxList->addAttribute(u"draw:marker-end-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 4)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 4.0)) + "mm"); else if( hdo->property.line_width > 60 ) mxList->addAttribute(u"draw:marker-end-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 5)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 5.0)) + "mm"); else if( hdo->property.line_width > 40 ) mxList->addAttribute(u"draw:marker-end-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 6)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 6.0)) + "mm"); else mxList->addAttribute(u"draw:marker-end-width"_ustr, sXML_CDATA, - OUString::number( WTMM(hdo->property.line_width * 7)) + "mm"); + OUString::number( WTMM(hdo->property.line_width * 7.0)) + "mm"); } }