summaryrefslogtreecommitdiff
path: root/xmloff/source/draw/ximpshap.cxx
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2024-06-23 20:24:44 +0200
committerRegina Henschel <rb.henschel@t-online.de>2024-06-25 16:21:42 +0200
commit9f62c7a0f2333d1b7d179a43b3b0341dba7554a1 (patch)
treee44291701e940fbc69896a8f5a6d42c9a88e2319 /xmloff/source/draw/ximpshap.cxx
parent7a13e4a9edca15a8f3410417ef15c6b002f3de64 (diff)
tdf#161483 enable LO to read ODF angle units
ODF uses in several places data type 'angle' (18.3.1, ODF 1.3). That is a double followed by unit identifier 'deg', 'grad' or 'rad' or a unit less value in degrees. LO uses in the API angles in degrees, 1/10 of degrees and 1/100 of degrees in data types 'double', 'short' and 'long'. Without the fix LO does not interpret the units, but takes only the number part. Change-Id: Ib3f2a518a25199e3cf7a7a8572e169785f75c427 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169360 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'xmloff/source/draw/ximpshap.cxx')
-rw-r--r--xmloff/source/draw/ximpshap.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 27e98821f19b..89bb474f928e 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -1157,15 +1157,15 @@ bool SdXMLEllipseShapeContext::processAttribute( const sax_fastparser::FastAttri
case XML_ELEMENT(DRAW, XML_START_ANGLE):
{
double dStartAngle;
- if (::sax::Converter::convertDouble( dStartAngle, aIter.toView() ))
- mnStartAngle = static_cast<sal_Int32>(dStartAngle * 100.0);
+ if (::sax::Converter::convertAngle( dStartAngle, aIter.toView(), 100))
+ mnStartAngle = static_cast<sal_Int32>(basegfx::fround(dStartAngle));
break;
}
case XML_ELEMENT(DRAW, XML_END_ANGLE):
{
double dEndAngle;
- if (::sax::Converter::convertDouble( dEndAngle, aIter.toView() ))
- mnEndAngle = static_cast<sal_Int32>(dEndAngle * 100.0);
+ if (::sax::Converter::convertAngle( dEndAngle, aIter.toView(), 100))
+ mnEndAngle = static_cast<sal_Int32>(basegfx::fround(dEndAngle));
break;
}
default: