diff options
-rw-r--r-- | i18nlangtag/source/languagetag/languagetag.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index 3d2fc8aaf22f..01cd6d25d218 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -94,6 +94,7 @@ typedef ::std::map< OUString, LanguageTag::ImplPtr, compareIgnoreAsciiCaseLess > typedef ::std::map< LanguageType, LanguageTag::ImplPtr > MapLangID; struct theMapBcp47 : public rtl::Static< MapBcp47, theMapBcp47 > {}; struct theMapLangID : public rtl::Static< MapLangID, theMapLangID > {}; +struct theDontKnow : public rtl::Static< LanguageTag::ImplPtr, theDontKnow > {}; } @@ -787,6 +788,16 @@ LanguageTag::ImplPtr LanguageTag::registerImpl() const } } } + else if (mbInitializedLangID && mnLangID == LANGUAGE_DONTKNOW) + { + // Heavy usage of LANGUAGE_DONTKNOW, make it an own Impl for all the + // conversion attempts. At the same time provide a central breakpoint + // to inspect such places. + LanguageTag::ImplPtr& rDontKnow = theDontKnow::get(); + if (!rDontKnow) + rDontKnow.reset( new LanguageTagImpl( *this)); + pImpl = rDontKnow; + } else { SAL_WARN( "i18nlangtag", "LanguageTag::registerImpl: can't register for 0x" << ::std::hex << mnLangID ); |