Kaydet (Commit) b641e39d authored tarafından Eike Rathke's avatar Eike Rathke

added convertToLanguageTypeWithFallback()

Change-Id: Ib57a7c6fc57192b4a615f5ad0e43c580769513e9
üst d695e8d0
...@@ -1633,4 +1633,11 @@ LanguageType LanguageTag::convertToLanguageType( const OUString& rBcp47, bool bR ...@@ -1633,4 +1633,11 @@ LanguageType LanguageTag::convertToLanguageType( const OUString& rBcp47, bool bR
return LanguageTag( rBcp47).getLanguageType( bResolveSystem); return LanguageTag( rBcp47).getLanguageType( bResolveSystem);
} }
// static
LanguageType LanguageTag::convertToLanguageTypeWithFallback( const OUString& rBcp47 )
{
return LanguageTag( rBcp47).makeFallback().getLanguageType( true);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -435,6 +435,19 @@ public: ...@@ -435,6 +435,19 @@ public:
*/ */
static LanguageType convertToLanguageType( const OUString& rBcp47, bool bResolveSystem = true ); static LanguageType convertToLanguageType( const OUString& rBcp47, bool bResolveSystem = true );
/** Convert BCP 47 string to MS-LangID with fallback, convenience method.
NOTE: exists only for consistency with the other convertTo...()
methods, internally uses a temporary LanguageTag instance for
conversion so does not save anything compared to
LanguageTag(rBcp47).makeFallback().getLanguageType(bResolveSystem).
@see makeFallback()
Always resolves an empty tag to the system locale.
*/
static LanguageType convertToLanguageTypeWithFallback( const OUString& rBcp47 );
private: private:
enum Decision enum Decision
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment