summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-09-20 15:39:06 +0200
committerEike Rathke <erack@redhat.com>2013-09-20 18:31:05 +0200
commit01bde208acc429a0c65fdf6e65415ebea72e9ddc (patch)
treec1f4b2394072c8b752a1ea134e8b2a3dc7f08b77
parente81359a9a3240187bf3a02fdb48b8709238bdc51 (diff)
added isOnTheFlyID()
Change-Id: Ifddbec485814e3287e671e6bc4059689ca3f6c93
-rw-r--r--i18nlangtag/source/languagetag/languagetag.cxx11
-rw-r--r--include/i18nlangtag/languagetag.hxx3
2 files changed, 14 insertions, 0 deletions
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index 7d0359702860..ee4a1425cd7f 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -126,6 +126,17 @@ static LanguageType getNextOnTheFlyLanguage()
}
+// static
+bool LanguageTag::isOnTheFlyID( LanguageType nLang )
+{
+ LanguageType nPri = MsLangId::getPrimaryLanguage( nLang);
+ LanguageType nSub = MsLangId::getSubLanguage( nLang);
+ return
+ LANGUAGE_ON_THE_FLY_START <= nPri && nPri <= LANGUAGE_ON_THE_FLY_END &&
+ LANGUAGE_ON_THE_FLY_SUB_START <= nSub && nSub <= LANGUAGE_ON_THE_FLY_SUB_END;
+}
+
+
/** 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.
diff --git a/include/i18nlangtag/languagetag.hxx b/include/i18nlangtag/languagetag.hxx
index 50cfef553431..27bcb34c2927 100644
--- a/include/i18nlangtag/languagetag.hxx
+++ b/include/i18nlangtag/languagetag.hxx
@@ -484,6 +484,9 @@ public:
*/
static com::sun::star::lang::Locale convertToLocaleWithFallback( const OUString& rBcp47 );
+ /** If nLang is a generated on-the-fly LangID */
+ static bool isOnTheFlyID( LanguageType nLang );
+
typedef ::boost::shared_ptr< LanguageTagImpl > ImplPtr;
private: