summaryrefslogtreecommitdiff
path: root/linguistic/source/dicimp.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/dicimp.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/dicimp.cxx')
-rw-r--r--linguistic/source/dicimp.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index dafa95d7b6fa..231779b8e7dd 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -419,7 +419,10 @@ sal_uLong DictionaryNeo::saveEntries(const OUString &rURL)
pStream->WriteLine(rtl::OString(pVerOOo7));
if (0 != (nErr = pStream->GetError()))
return nErr;
- if (nLanguage == LANGUAGE_NONE)
+ /* XXX: the <none> case could be differentiated, is it absence or
+ * undetermined or multiple? Earlier versions did not know about 'und' and
+ * 'mul' and 'zxx' codes. Sync with ReadDicVersion() */
+ if (LinguIsUnspecified(nLanguage))
pStream->WriteLine(rtl::OString(RTL_CONSTASCII_STRINGPARAM("lang: <none>")));
else
{
@@ -773,7 +776,7 @@ void SAL_CALL DictionaryNeo::setLocale( const Locale& aLocale )
throw(RuntimeException)
{
MutexGuard aGuard( GetLinguMutex() );
- sal_Int16 nLanguageP = LanguageTag( aLocale ).getLanguageType();
+ sal_Int16 nLanguageP = LinguLocaleToLanguage( aLocale );
if (!bIsReadonly && nLanguage != nLanguageP)
{
nLanguage = nLanguageP;