[Libreoffice-commits] core.git: xmloff/source

Laurent Balland-Poirier laurent.balland-poirier at laposte.net
Mon May 30 22:13:38 UTC 2016


 xmloff/source/style/xmlnumfe.cxx |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

New commits:
commit b07e0a11766f2d2878a0dc2681feddb0c381c68d
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Sat May 28 21:56:14 2016 +0200

    Choose ODF version for fill-character
    
    OASIS reference: https://issues.oasis-open.org/browse/OFFICE-3765
    
    XML_TEXT in FinishTextElement_Impl follows a different logic
    See https://cgit.freedesktop.org/libreoffice/core/commit?id=66c6d1ef204f3507e7663a1b8b1be05b9ec71092
    
    Change-Id: Iac966f74c26c2b72ed54db26cf17a35717263007
    Reviewed-on: https://gerrit.libreoffice.org/25590
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 121a381..dc785d07 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -521,10 +521,17 @@ void SvXMLNumFmtExport::WriteMinutesElement_Impl( bool bLong )
 
 void SvXMLNumFmtExport::WriteRepeatedElement_Impl( sal_Unicode nChar )
 {
-    FinishTextElement_Impl(true);
-    SvXMLElementExport aElem( rExport, XML_NAMESPACE_LO_EXT, XML_FILL_CHARACTER,
-                                  true, false );
-    rExport.Characters( OUString( nChar ) );
+    // Export only for 1.2 with extensions or 1.3 and later.
+    SvtSaveOptions::ODFSaneDefaultVersion eVersion = rExport.getSaneDefaultVersion();
+    if (eVersion > SvtSaveOptions::ODFSVER_012)
+    {
+        FinishTextElement_Impl(true);
+        // For 1.2+ use loext namespace, for 1.3 use number namespace.
+        SvXMLElementExport aElem( rExport,
+                                  ((eVersion < SvtSaveOptions::ODFSVER_013) ? XML_NAMESPACE_LO_EXT : XML_NAMESPACE_NUMBER),
+                                  XML_FILL_CHARACTER, true, false );
+        rExport.Characters( OUString( nChar ) );
+    }
 }
 
 void SvXMLNumFmtExport::WriteSecondsElement_Impl( bool bLong, sal_uInt16 nDecimals )


More information about the Libreoffice-commits mailing list