summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/sax/tools/converter.hxx8
1 files changed, 8 insertions, 0 deletions
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);