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

Eike Rathke erack at redhat.com
Thu Jun 12 02:03:03 PDT 2014


 i18nlangtag/source/languagetag/languagetag.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 9476bd39ad30eea46ff146f46d6c996450710b3c
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Jun 12 10:57:15 2014 +0200

    disallow 'qlt' privateuse code
    
    ... to prevent confusion with our internal usage.
    
    Change-Id: I273b80882cbe5029d04ad754c8b0636f5c59a4f6

diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index b7b8aa1..c81197a 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -2720,6 +2720,20 @@ bool LanguageTag::isValidBcp47( const OUString& rString, OUString* o_pCanonicali
                 const lt_string_t* pPrivate = lt_tag_get_privateuse( aVar.mpLangtag);
                 if (pPrivate && lt_string_length( pPrivate) > 0)
                     bValid = false;
+                else
+                {
+                    const lt_lang_t* pLangT = lt_tag_get_language( aVar.mpLangtag);
+                    if (pLangT)
+                    {
+                        const char* pLang = lt_lang_get_tag( pLangT);
+                        if (pLang && strcmp( pLang, I18NLANGTAG_QLT) == 0)
+                        {
+                            // Disallow 'qlt' privateuse code to prevent
+                            // confusion with our internal usage.
+                            bValid = false;
+                        }
+                    }
+                }
             }
             if (o_pCanonicalized)
                 *o_pCanonicalized = OUString::createFromAscii( pTag);


More information about the Libreoffice-commits mailing list