diff options
author | Eike Rathke <erack@redhat.com> | 2013-09-20 18:05:46 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-09-20 18:31:07 +0200 |
commit | f77085ce584b1400d4d245582fa3e214143e9c09 (patch) | |
tree | c4cb1cf5684e89d2504bcddbd750f54b6760fcb0 | |
parent | ababc9bba77784754b7c903d24f08b1869c584ef (diff) |
theDontKnow Impl
Change-Id: I6d4738041e3f4eaffc3adbdb0b324eda24903b72
-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 ); |