diff options
author | Eike Rathke <erack@redhat.com> | 2013-09-17 22:19:17 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-09-17 22:19:57 +0200 |
commit | 19863a06d71996f82b2d7d32408b2b1830890a3a (patch) | |
tree | 3122020f40c974a2a4f89124d68f592a55892bc7 /i18nlangtag | |
parent | af2abfe3547bf0bfdc52ea2e45a35bbc24342761 (diff) |
added getNextOnTheFlyLanguage()
Change-Id: I58eeab0076b5b77b533bf855d3879228fe653658
Diffstat (limited to 'i18nlangtag')
-rw-r--r-- | i18nlangtag/source/languagetag/languagetag.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index 5987ffee9831..93f9823f19a0 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -86,6 +86,36 @@ static const KnownTagSet & getKnowns() } +/* TODO: this is how on-the-fly LangID assignment will work, now implement + * usage and registration. */ +#if 0 +static LanguageType getNextOnTheFlyLanguage() +{ + static LanguageType nOnTheFlyLanguage = 0; + osl::MutexGuard aGuard( theMutex::get()); + if (!nOnTheFlyLanguage) + nOnTheFlyLanguage = MsLangId::makeLangID( LANGUAGE_ON_THE_FLY_SUB_START, LANGUAGE_ON_THE_FLY_START); + else + { + if (MsLangId::getPrimaryLanguage( nOnTheFlyLanguage) != LANGUAGE_ON_THE_FLY_END) + ++nOnTheFlyLanguage; + else + { + LanguageType nSub = MsLangId::getSubLanguage( nOnTheFlyLanguage); + if (nSub != LANGUAGE_ON_THE_FLY_SUB_END) + nOnTheFlyLanguage = MsLangId::makeLangID( ++nSub, LANGUAGE_ON_THE_FLY_START); + else + SAL_WARN( "i18nlangtag", "getNextOnTheFlyLanguage: none left! (" + << ((LANGUAGE_ON_THE_FLY_END - LANGUAGE_ON_THE_FLY_START + 1) + * (LANGUAGE_ON_THE_FLY_SUB_END - LANGUAGE_ON_THE_FLY_SUB_START + 1)) + << " consumed?!?)"); + } + } + return nOnTheFlyLanguage; +} +#endif + + /** A reference holder for liblangtag data de/initialization, one static instance. Currently implemented such that the first "ref" inits and dtor (our library deinitialized) tears down. |