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

Eike Rathke erack at redhat.com
Wed Jul 10 05:20:26 PDT 2013


 xmloff/source/style/chrlohdl.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 8a4307e4bb0eab3dd0a2a82c1fd4b2eab5df9a2e
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jul 10 14:18:24 2013 +0200

    do not write attributes with 'none' for non-ISO language/country
    
    Change-Id: I774a4a8a283828d81fdab93e33fb3b2aa0cf680b

diff --git a/xmloff/source/style/chrlohdl.cxx b/xmloff/source/style/chrlohdl.cxx
index 9fd0cfe..4a0ee09 100644
--- a/xmloff/source/style/chrlohdl.cxx
+++ b/xmloff/source/style/chrlohdl.cxx
@@ -117,6 +117,11 @@ sal_Bool XMLCharLanguageHdl::exportXML( OUString& rStrExpValue, const uno::Any&
         LanguageTag aLanguageTag( aLocale);
         OUString aCountry;
         aLanguageTag.getIsoLanguageCountry( rStrExpValue, aCountry);
+        // Do not write *:language='none' for a non-ISO language with
+        // *:rfc-language-tag that is written if Variant is not empty. If there
+        // is no match do not write this attribute at all.
+        if (rStrExpValue.isEmpty())
+            return sal_False;
     }
 
     if( rStrExpValue.isEmpty() )
@@ -298,6 +303,11 @@ sal_Bool XMLCharCountryHdl::exportXML( OUString& rStrExpValue, const uno::Any& r
         LanguageTag aLanguageTag( aLocale);
         OUString aLanguage;
         aLanguageTag.getIsoLanguageCountry( aLanguage, rStrExpValue);
+        // Do not write *:country='none' for a non-ISO country with
+        // *:rfc-language-tag that is written if Variant is not empty. If there
+        // is no match do not write this attribute at all.
+        if (rStrExpValue.isEmpty())
+            return sal_False;
     }
 
     if( rStrExpValue.isEmpty() )


More information about the Libreoffice-commits mailing list