summaryrefslogtreecommitdiff
path: root/linguistic/source/misc.cxx
diff options
context:
space:
mode:
authorThomas Lange <tl@openoffice.org>2000-12-15 09:21:30 +0000
committerThomas Lange <tl@openoffice.org>2000-12-15 09:21:30 +0000
commit97ccaeed4795f751c92d4b86747c4605b9cdf535 (patch)
treea932d5e7f42e2520b8246ae8c7229484b1ce276d /linguistic/source/misc.cxx
parentc9a265c4184c1419c7e8656fa118378c46de3854 (diff)
Locale <-> LanguageType functions adapted to change in ConvertLanguageToIsoNames
Diffstat (limited to 'linguistic/source/misc.cxx')
-rw-r--r--linguistic/source/misc.cxx39
1 files changed, 17 insertions, 22 deletions
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index c2bde6c86175..d7caae39b197 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: misc.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: tl $ $Date: 2000-11-21 18:29:14 $
+ * last change: $Author: tl $ $Date: 2000-12-15 10:21:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -214,44 +214,39 @@ Reference< XDictionaryEntry > SearchDicList(
///////////////////////////////////////////////////////////////////////////
-Locale CreateLocale( LanguageType eLang )
-{
- if ( eLang == LANGUAGE_NONE )
- eLang = LANGUAGE_SYSTEM;
- String aLangStr, aCtryStr;
- ConvertLanguageToIsoNames( eLang, aLangStr, aCtryStr );
-
- return Locale( aLangStr, aCtryStr, OUString() );
-}
-
LanguageType LocaleToLanguage( const Locale& rLocale )
{
- // empty language -> LANGUAGE_NONE
+ // empty Locale -> LANGUAGE_NONE
if ( rLocale.Language.getLength() == 0 )
return LANGUAGE_NONE;
// Variant of Locale is ignored
- LanguageType eRet =
- ConvertIsoNamesToLanguage( rLocale.Language, rLocale.Country );
- if ( eRet == LANGUAGE_SYSTEM )
- eRet = LANGUAGE_NONE;
-
- return eRet;
+ return ConvertIsoNamesToLanguage( rLocale.Language, rLocale.Country );
}
Locale& LanguageToLocale( Locale& rLocale, LanguageType eLang )
{
String aLangStr, aCtryStr;
- if ( eLang == LANGUAGE_NONE )
- eLang = LANGUAGE_SYSTEM;
- ConvertLanguageToIsoNames( eLang, aLangStr, aCtryStr );
+ if ( eLang != LANGUAGE_NONE /* && eLang != LANGUAGE_SYSTEM */)
+ ConvertLanguageToIsoNames( eLang, aLangStr, aCtryStr );
+
rLocale.Language = aLangStr;
rLocale.Country = aCtryStr;
+ rLocale.Variant = OUString();
return rLocale;
}
+Locale CreateLocale( LanguageType eLang )
+{
+ String aLangStr, aCtryStr;
+ if ( eLang != LANGUAGE_NONE /* && eLang != LANGUAGE_SYSTEM */)
+ ConvertLanguageToIsoNames( eLang, aLangStr, aCtryStr );
+
+ return Locale( aLangStr, aCtryStr, OUString() );
+}
+
uno::Sequence< Locale > LangSeqToLocaleSeq( const uno::Sequence< INT16 > &rLangSeq )
{
const INT16 *pLang = rLangSeq.getConstArray();