[Libreoffice-commits] core.git: i18nlangtag/source
Eike Rathke
erack at redhat.com
Thu Nov 21 07:00:08 PST 2013
i18nlangtag/source/languagetag/languagetag.cxx | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit 017a2a368cee1f6f5e7c6e18e65cbbc1a54efe47
Author: Eike Rathke <erack at redhat.com>
Date: Thu Nov 21 15:57:53 2013 +0100
handleVendorVariant() strip in case some was injected
Change-Id: I73c42a99671524e9fb186257a9bc943d514958c2
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index 60e8c12..3a15ecc 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -230,6 +230,17 @@ void LiblantagDataRef::setupDataPath()
}
+/* TODO: we could transform known vendor and browser-specific variants to known
+ * BCP 47 if available. For now just remove them to not confuse any later
+ * treatments that check for empty variants. This vendor stuff was never
+ * supported anyway. */
+static void handleVendorVariant( com::sun::star::lang::Locale & rLocale )
+{
+ if (!rLocale.Variant.isEmpty() && rLocale.Language != I18NLANGTAG_QLT)
+ rLocale.Variant = OUString();
+}
+
+
class LanguageTagImpl
{
public:
@@ -483,6 +494,7 @@ LanguageTag::LanguageTag( const com::sun::star::lang::Locale & rLocale )
mbInitializedLangID( false),
mbIsFallback( false)
{
+ handleVendorVariant( maLocale);
}
@@ -1025,6 +1037,7 @@ LanguageTag & LanguageTag::reset( const com::sun::star::lang::Locale & rLocale )
maLocale = rLocale;
mbSystemLocale = rLocale.Language.isEmpty();
mbInitializedLocale = !mbSystemLocale;
+ handleVendorVariant( maLocale);
return *this;
}
More information about the Libreoffice-commits
mailing list