diff options
author | Eike Rathke <erack@redhat.com> | 2012-11-16 22:31:09 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-11-16 22:32:19 +0100 |
commit | 15e274a37c75eedb6e2fae07e4689cef67cdf2d7 (patch) | |
tree | 0094b2632c2d53aa8025832a5863688aa12be7f9 /i18npool/inc | |
parent | Fix the Windows build breakage by reorganizing svtools headers. (diff) | |
download | core-15e274a37c75eedb6e2fae07e4689cef67cdf2d7.tar.gz core-15e274a37c75eedb6e2fae07e4689cef67cdf2d7.zip |
added LanguageTag::makeFallback()
Change-Id: I6a89dd2c5e34035ac1e6c9b7e4723d881c5ceaa9
Diffstat (limited to 'i18npool/inc')
-rw-r--r-- | i18npool/inc/i18npool/languagetag.hxx | 10 | ||||
-rw-r--r-- | i18npool/inc/i18npool/mslangid.hxx | 11 |
2 files changed, 18 insertions, 3 deletions
diff --git a/i18npool/inc/i18npool/languagetag.hxx b/i18npool/inc/i18npool/languagetag.hxx index 552110dc4366..c5ce23254bea 100644 --- a/i18npool/inc/i18npool/languagetag.hxx +++ b/i18npool/inc/i18npool/languagetag.hxx @@ -187,6 +187,15 @@ public: /** Reset with LanguageType MS-LangID. */ void reset( LanguageType nLanguage ); + + /** Fall back to a known locale. + + If the current tag does not represent a known (by us) locale, fall back + to the most likely locale possible known. + If the current tag is known, no change occurs. + */ + LanguageTag & makeFallback(); + private: enum Decision @@ -213,6 +222,7 @@ private: mutable bool mbCachedLanguage : 1; mutable bool mbCachedScript : 1; mutable bool mbCachedCountry : 1; + bool mbIsFallback : 1; void convertLocaleToBcp47(); void convertLocaleToLang(); diff --git a/i18npool/inc/i18npool/mslangid.hxx b/i18npool/inc/i18npool/mslangid.hxx index 574a07dbabe4..120d9c6313d4 100644 --- a/i18npool/inc/i18npool/mslangid.hxx +++ b/i18npool/inc/i18npool/mslangid.hxx @@ -149,6 +149,14 @@ private: const ::com::sun::star::lang::Locale & rLocale ); + /** To be used only by LanguageTag. */ + I18NISOLANG_DLLPRIVATE static LanguageType lookupFallbackLanguage( LanguageType nLang ); + + /** To be used only by LanguageTag. */ + I18NISOLANG_DLLPRIVATE static ::com::sun::star::lang::Locale lookupFallbackLocale( + const ::com::sun::star::lang::Locale & rLocale ); + + #if I18NPOOL_FORCE_LANGUAGETAG public: #endif @@ -317,12 +325,9 @@ private: I18NISOLANG_DLLPRIVATE static inline LanguageType simplifySystemLanguages( LanguageType nLang ); // Several locale lookups with fall-back - I18NISOLANG_DLLPRIVATE static LanguageType lookupFallbackLanguage( LanguageType nLang ); I18NISOLANG_DLLPRIVATE static LanguageType lookupFallbackLanguage( const ::com::sun::star::lang::Locale & rLocale ); I18NISOLANG_DLLPRIVATE static ::com::sun::star::lang::Locale lookupFallbackLocale( LanguageType nLang ); - I18NISOLANG_DLLPRIVATE static ::com::sun::star::lang::Locale lookupFallbackLocale( - const ::com::sun::star::lang::Locale & rLocale ); }; |