From 241ccc2568dd685d224f8a2b051c3e3a018d9400 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 9 Jan 2013 16:48:52 +0100 Subject: resolved fdo#58503 restore awkward handling of empty locale for legacy Partly reverts d7a5ec62e91ce3dc5b784815254218f16181f676 An empty locale was treated as LANGUAGE_NONE, effectively being interpreted as absence or undetermined or multiple or all depending on context. Restore this behavior as it was an undocumented feature of the API. Change-Id: If4b1641e776d10dea0d3037f7a62725c2b8d612c --- linguistic/source/thesdsp.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'linguistic/source/thesdsp.cxx') diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index e8656af3e914..dfd106f0eac7 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -101,7 +101,7 @@ sal_Bool SAL_CALL throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - ThesSvcByLangMap_t::const_iterator aIt( aSvcMap.find( LanguageTag( rLocale ).getLanguageType() ) ); + ThesSvcByLangMap_t::const_iterator aIt( aSvcMap.find( LinguLocaleToLanguage( rLocale ) ) ); return aIt != aSvcMap.end(); } @@ -116,8 +116,8 @@ Sequence< Reference< XMeaning > > SAL_CALL Sequence< Reference< XMeaning > > aMeanings; - sal_Int16 nLanguage = LanguageTag( rLocale ).getLanguageType(); - if (nLanguage == LANGUAGE_NONE || rTerm.isEmpty()) + sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale ); + if (LinguIsUnspecified( nLanguage) || rTerm.isEmpty()) return aMeanings; // search for entry with that language @@ -210,7 +210,7 @@ void ThesaurusDispatcher::SetServiceList( const Locale &rLocale, { MutexGuard aGuard( GetLinguMutex() ); - sal_Int16 nLanguage = LanguageTag( rLocale ).getLanguageType(); + sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale ); sal_Int32 nLen = rSvcImplNames.getLength(); if (0 == nLen) @@ -244,7 +244,7 @@ Sequence< OUString > Sequence< OUString > aRes; // search for entry with that language and use data from that - sal_Int16 nLanguage = LanguageTag( rLocale ).getLanguageType(); + sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale ); ThesaurusDispatcher *pThis = (ThesaurusDispatcher *) this; const ThesSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) ); const LangSvcEntries_Thes *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; -- cgit