diff options
author | Eike Rathke <erack@redhat.com> | 2015-03-22 16:33:20 +0000 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-03-22 16:52:47 +0000 |
commit | ee7e182591cc2a1e43f7d44204f00a316f22f07b (patch) | |
tree | 6d599b5cd052f145f10d3b819b6ba65b777911f6 /xmloff | |
parent | bff1b48899c73d381e675eb647f85c01c6fd354f (diff) |
write exponent-interval only for 1.2+ and later, tdf#30716 follow-up
... and prepare for distinguishing between 1.2+ and 1.3
Change-Id: I8d491be4b0ff5f65fc1506145f460f07e8371a73
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/xmlnumfe.cxx | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index f9402d2a6a28..e8a86171a4bc 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -667,9 +667,25 @@ void SvXMLNumFmtExport::WriteScientificElement_Impl( // exponent interval for engineering notation if ( nExpInterval >= 0 ) - { // when exponent-interval will be part of ODF 1.3, change to XML_NAMESPACE_NUMBER - rExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_EXPONENT_INTERVAL, - OUString::number( nExpInterval ) ); + { + // Export only for 1.2 with extensions or 1.3 and later. + SvtSaveOptions::ODFDefaultVersion eVersion = SvtSaveOptions().GetODFDefaultVersion(); + if (eVersion > SvtSaveOptions::ODFVER_012) + { + // TODO: change this once the fouled up ODFVER_LATEST is a real + // 1.2+ or 1.3 or 1.3+ ... and only in configuration means latest. +#if 1 + // Currently 1.2+ is ODFVER_LATEST which is >ODFVER_012 and + // >ODFVER_013 and prevents correct handling.. + rExport.AddAttribute( XML_NAMESPACE_LO_EXT, + XML_EXPONENT_INTERVAL, OUString::number( nExpInterval ) ); +#else + // For 1.2+ use loext namespace, for 1.3 use number namespace. + rExport.AddAttribute( + ((eVersion < SvtSaveOptions::ODFVER_013) ? XML_NAMESPACE_LO_EXT : XML_NAMESPACE_NUMBER), + XML_EXPONENT_INTERVAL, OUString::number( nExpInterval ) ); +#endif + } } SvXMLElementExport aElem( rExport, |