From 9f62c7a0f2333d1b7d179a43b3b0341dba7554a1 Mon Sep 17 00:00:00 2001 From: Regina Henschel Date: Sun, 23 Jun 2024 20:24:44 +0200 Subject: 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 Tested-by: Jenkins Reviewed-by: Regina Henschel --- include/sax/tools/converter.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/sax') diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx index bb97acc595ac..e6568faffbd6 100644 --- a/include/sax/tools/converter.hxx +++ b/include/sax/tools/converter.hxx @@ -210,6 +210,14 @@ public: static bool convert10thDegAngle(sal_Int16& rAngle, std::string_view rString, bool isWrongOOo10thDegAngle); + /** convert SVG angle to number, in 1/nFactor of degrees, range [0..nFactor*360[ */ + static bool convertAngle(double& rAngle, std::u16string_view rString, + const sal_uInt16& nFactor = 1); + + /** convert SVG angle to number, in 1/nFactor of degrees, range [0..nFactor*360[ */ + static bool convertAngle(double& rAngle, std::string_view rString, + const sal_uInt16& nFactor = 1); + /** convert double to XMLSchema-2 "duration" string; negative durations allowed */ static void convertDuration(OUStringBuffer& rBuffer, const double fTime); -- cgit