summaryrefslogtreecommitdiff
path: root/i18nlangtag
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-09-20 17:27:20 +0200
committerEike Rathke <erack@redhat.com>2013-09-20 18:31:06 +0200
commit79dbf611175e8a91557e288feb463f78fa1a06b9 (patch)
treecaa0a31f2fb67d1c42c40c9ea6c8c598dd94b7e2 /i18nlangtag
parentc640f19ca3aa1d918bd8df454d5ec45fbc2fad05 (diff)
do not register LANGUAGE_DONTKNOW
Change-Id: Ibfe4407c1b2740e806c7d9cb75529a8babc3fd92
Diffstat (limited to 'i18nlangtag')
-rw-r--r--i18nlangtag/source/languagetag/languagetag.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index 91de5fd90d06..bf835195686e 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -676,7 +676,8 @@ LanguageTag::ImplPtr LanguageTag::registerImpl() const
#endif
// Prefer LangID map as find+insert needs less comparison work.
- if (mbInitializedLangID)
+ // Never insert LANGUAGE_DONTKNOW
+ if (mbInitializedLangID && mnLangID != LANGUAGE_DONTKNOW)
{
MapLangID& rMap = theMapLangID::get();
MapLangID::const_iterator it( rMap.find( mnLangID));
@@ -753,10 +754,13 @@ LanguageTag::ImplPtr LanguageTag::registerImpl() const
OUString aBcp47;
if (!bInsert)
{
- // May have involved canonicalize(), so compare with pImpl->maBcp47!
- aBcp47 = LanguageTagImpl::convertToBcp47(
+ if (pImpl->mnLangID != LANGUAGE_DONTKNOW)
+ {
+ // May have involved canonicalize(), so compare with pImpl->maBcp47!
+ aBcp47 = LanguageTagImpl::convertToBcp47(
MsLangId::Conversion::convertLanguageToLocale( pImpl->mnLangID, true));
- bInsert = (aBcp47 == pImpl->maBcp47);
+ bInsert = (aBcp47 == pImpl->maBcp47);
+ }
}
// If round-trip is identical cross-insert to Bcp47 map.
if (bInsert)