diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-05-18 18:43:51 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-05-19 17:04:33 +0200 |
commit | 693cefb59286daf6ff86f1db16f0d64b4b9b4588 (patch) | |
tree | 85ffc717387c77c159ac3dcc3111fb91d2fde7c2 /include/sax | |
parent | xmloff,filter: Flat ODF import: import BuildId from meta:generator (diff) | |
download | core-693cefb59286daf6ff86f1db16f0d64b4b9b4588.tar.gz core-693cefb59286daf6ff86f1db16f0d64b4b9b4588.zip |
tdf#89475 xmloff: ODF import/export: continue fixing draw:angle
Continue what commit aadda5d17f6e422da143ea774f759bfc5f629c5b
started wrt. unit-less draw:angle attributes in ODF >= 1.2:
* ODF 1.3 files don't ever have unit-less draw:angle interpreted as
10th of degree
* import unit-less draw:angle as degree, except if it's ODF 1.0/1.1 or
it's ODF 1.2 written by OOo/LO < 7.0, then 10th of degree
* export draw:angle with "deg", which LO 4.4 and newer can read; except
if exporting ODF 1.0/1.1 or ODF 1.2 Extended (compatibility mode),
then 10th of degree (unit-less)
The only problem with this is that if you store a file as ODF 1.2
Extended (compatibility mode) and load it with LO 7.0 it will interpret
the angle wrong, but nothing's perfect...
Change-Id: I3771e6571afd40e44b6f7890dacf18c28841610f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94443
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'include/sax')
-rw-r--r-- | include/sax/tools/converter.hxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx index 9f7f5b3df50f..e5e6d5764d0f 100644 --- a/include/sax/tools/converter.hxx +++ b/include/sax/tools/converter.hxx @@ -31,6 +31,7 @@ #include <rtl/ustrbuf.hxx> #include <com/sun/star/util/MeasureUnit.hpp> #include <tools/color.hxx> +#include <unotools/saveopt.hxx> namespace com::sun::star { namespace uno { @@ -146,10 +147,12 @@ public: static bool convertDouble(double& rValue, const OUString& rString); /** convert number, 10th of degrees with range [0..3600] to SVG angle */ - static void convertAngle(OUStringBuffer& rBuffer, sal_Int16 nAngle); + static void convertAngle(OUStringBuffer& rBuffer, sal_Int16 nAngle, + SvtSaveOptions::ODFSaneDefaultVersion nVersion); /** convert SVG angle to number, 10th of degrees with range [0..3600] */ - static bool convertAngle(sal_Int16& rAngle, OUString const& rString); + static bool convertAngle(sal_Int16& rAngle, OUString const& rString, + bool isWrongOOo10thDegAngle); /** convert double to XMLSchema-2 "duration" string; negative durations allowed */ static void convertDuration(OUStringBuffer& rBuffer, |