diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/chrlohdl.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xmloff/source/style/chrlohdl.cxx b/xmloff/source/style/chrlohdl.cxx index 9fd0cfe6625b..4a0ee091c680 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() ) |