From b291852c2f907e5d181b1de43af216f7d03db96a Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 12 Sep 2013 19:31:04 +0200 Subject: get rid of unnecessary conversion, use LinguIsUnspecified(OUString) Change-Id: Ib1074e3025680306c0a8bf7dcff651cefdcb90ba --- linguistic/source/misc.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'linguistic') diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 867dccfc4c38..fe24438a0b6c 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -106,6 +106,19 @@ bool LinguIsUnspecified( LanguageType nLanguage ) return false; } +// When adding anything keep both LinguIsUnspecified() methods in sync! +// For mappings between language code string and LanguageType see +// i18nlangtag/source/isolang/isolang.cxx + +bool LinguIsUnspecified( const OUString & rBcp47 ) +{ + if (rBcp47.getLength() != 3) + return false; + if (rBcp47 == "zxx" || rBcp47 == "und" || rBcp47 == "mul") + return true; + return false; +} + static inline sal_Int32 Minimum( sal_Int32 n1, sal_Int32 n2, sal_Int32 n3 ) { sal_Int32 nMin = n1 < n2 ? n1 : n2; -- cgit