From 79dbf611175e8a91557e288feb463f78fa1a06b9 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 20 Sep 2013 17:27:20 +0200 Subject: do not register LANGUAGE_DONTKNOW Change-Id: Ibfe4407c1b2740e806c7d9cb75529a8babc3fd92 --- i18nlangtag/source/languagetag/languagetag.cxx | 12 ++++++++---- 1 file 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) -- cgit