summaryrefslogtreecommitdiff
path: root/linguistic/source/hyphdsp.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-01-09 16:48:52 +0100
committerEike Rathke <erack@redhat.com>2013-01-09 16:59:47 +0100
commit241ccc2568dd685d224f8a2b051c3e3a018d9400 (patch)
treeda12883cfc55e669e9fff14452b74c1825f4eff3 /linguistic/source/hyphdsp.cxx
parenta0bf71323741c5c58b77651fe656c73419dbf09f (diff)
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
Diffstat (limited to 'linguistic/source/hyphdsp.cxx')
-rw-r--r--linguistic/source/hyphdsp.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index ac08631f9862..757e836fc126 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -236,7 +236,7 @@ sal_Bool SAL_CALL HyphenatorDispatcher::hasLocale(const Locale& rLocale)
throw(RuntimeException)
{
MutexGuard aGuard( GetLinguMutex() );
- HyphSvcByLangMap_t::const_iterator aIt( aSvcMap.find( LanguageTag( rLocale ).getLanguageType() ) );
+ HyphSvcByLangMap_t::const_iterator aIt( aSvcMap.find( LinguLocaleToLanguage( rLocale ) ) );
return aIt != aSvcMap.end();
}
@@ -252,8 +252,8 @@ Reference< XHyphenatedWord > SAL_CALL
Reference< XHyphenatedWord > xRes;
sal_Int32 nWordLen = rWord.getLength();
- sal_Int16 nLanguage = LanguageTag( rLocale ).getLanguageType();
- if (nLanguage == LANGUAGE_NONE || !nWordLen ||
+ sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale );
+ if (LinguIsUnspecified(nLanguage) || !nWordLen ||
nMaxLeading == 0 || nMaxLeading == nWordLen)
return xRes;
@@ -390,8 +390,8 @@ Reference< XHyphenatedWord > SAL_CALL
Reference< XHyphenatedWord > xRes;
sal_Int32 nWordLen = rWord.getLength();
- sal_Int16 nLanguage = LanguageTag( rLocale ).getLanguageType();
- if (nLanguage == LANGUAGE_NONE || !nWordLen)
+ sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale );
+ if (LinguIsUnspecified(nLanguage) || !nWordLen)
return xRes;
// search for entry with that language
@@ -521,8 +521,8 @@ Reference< XPossibleHyphens > SAL_CALL
Reference< XPossibleHyphens > xRes;
- sal_Int16 nLanguage = LanguageTag( rLocale ).getLanguageType();
- if (nLanguage == LANGUAGE_NONE || rWord.isEmpty())
+ sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale );
+ if (LinguIsUnspecified(nLanguage) || rWord.isEmpty())
return xRes;
// search for entry with that language
@@ -638,7 +638,7 @@ void HyphenatorDispatcher::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)
@@ -673,7 +673,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 );
HyphenatorDispatcher *pThis = (HyphenatorDispatcher *) this;
const HyphSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) );
const LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;