summaryrefslogtreecommitdiff
path: root/lingucomponent
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-01-09 16:48:52 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-01-10 12:18:13 +0100
commitf4078cb3a2366263227328a53e6cab4631e04bd6 (patch)
tree5b5cd3ac6b6ba38b360f012bdfefda1c33037f46 /lingucomponent
parent6bfd791162fa392600ef8b8df6c1ac04bb4d4099 (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: I256b352961f09e41cadb3e44c9ef01ee7677fd31 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx8
-rw-r--r--lingucomponent/source/lingutil/lingutil.cxx2
-rw-r--r--lingucomponent/source/spellcheck/macosxspell/macspellimp.mm4
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx4
-rw-r--r--lingucomponent/source/thesaurus/libnth/nthesimp.cxx4
5 files changed, 11 insertions, 11 deletions
diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
index e7fe7a4de971..990b45bc68b7 100644
--- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
@@ -485,13 +485,13 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const ::rtl::OUStri
sal_Int16 nPos = (sal_Int16) ((nHyphenationPosAltHyph < nHyphenationPos) ?
nHyphenationPosAltHyph : nHyphenationPos);
// dicretionary hyphenation
- xRes = HyphenatedWord::CreateHyphenatedWord( aWord, LanguageTag( aLocale ).getLanguageType(), nPos,
+ xRes = HyphenatedWord::CreateHyphenatedWord( aWord, LinguLocaleToLanguage( aLocale ), nPos,
aWord.replaceAt(nHyphenationPosAlt + 1, cut[nHyphenationPos], repHyph),
(sal_Int16) nHyphenationPosAltHyph);
}
else
{
- xRes = HyphenatedWord::CreateHyphenatedWord( aWord, LanguageTag( aLocale ).getLanguageType(),
+ xRes = HyphenatedWord::CreateHyphenatedWord( aWord, LinguLocaleToLanguage( aLocale ),
(sal_Int16)nHyphenationPos, aWord, (sal_Int16) nHyphenationPos);
}
}
@@ -542,7 +542,7 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const
//well as "hyphenate"
if (aWord.getLength() < minLen)
{
- return PossibleHyphens::CreatePossibleHyphens( aWord, LanguageTag( aLocale ).getLanguageType(),
+ return PossibleHyphens::CreatePossibleHyphens( aWord, LinguLocaleToLanguage( aLocale ),
aWord, Sequence< sal_Int16 >() );
}
@@ -689,7 +689,7 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const
OUString hyphenatedWord = hyphenatedWordBuffer.makeStringAndClear();
Reference< XPossibleHyphens > xRes = PossibleHyphens::CreatePossibleHyphens(
- aWord, LanguageTag( aLocale ).getLanguageType(), hyphenatedWord, aHyphPos);
+ aWord, LinguLocaleToLanguage( aLocale ), hyphenatedWord, aHyphPos);
delete[] hyphens;
delete[] lcword;
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx
index 194f0b753f73..8754442e471f 100644
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
@@ -216,7 +216,7 @@ void MergeNewStyleDicsAndOldStyleDics(
{
LanguageType nLang = LanguageTag( aIt2->aLocaleNames[0] ).getLanguageType();
- if (nLang == LANGUAGE_DONTKNOW || nLang == LANGUAGE_NONE)
+ if (nLang == LANGUAGE_DONTKNOW || linguistic::LinguIsUnspecified( nLang))
{
OSL_FAIL( "old style dictionary with invalid language found!" );
continue;
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
index d021fc02693c..3149c02d6ddd 100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
@@ -296,7 +296,7 @@ sal_Bool SAL_CALL
sal_Int16 nFailure = GetSpellFailure( rWord, rLocale );
if (nFailure != -1)
{
- sal_Int16 nLang = LanguageTag( rLocale ).getLanguageType();
+ sal_Int16 nLang = LinguLocaleToLanguage( rLocale );
// postprocess result for errors that should be ignored
if ( (!rHelper.IsSpellUpperCase() && IsUpper( rWord, nLang ))
|| (!rHelper.IsSpellWithDigits() && HasDigits( rWord ))
@@ -320,7 +320,7 @@ Reference< XSpellAlternatives >
Reference< XSpellAlternatives > xRes;
// note: mutex is held by higher up by spell which covers both
- sal_Int16 nLang = LanguageTag( rLocale ).getLanguageType();
+ sal_Int16 nLang = LinguLocaleToLanguage( rLocale );
int count;
Sequence< OUString > aStr( 0 );
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 160eed154c4f..273743b57057 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -375,7 +375,7 @@ sal_Bool SAL_CALL SpellChecker::isValid( const OUString& rWord, const Locale& rL
sal_Int16 nFailure = GetSpellFailure( rWord, rLocale );
if (nFailure != -1 && !rWord.match(A2OU(SPELLML_HEADER), 0))
{
- sal_Int16 nLang = LanguageTag( rLocale ).getLanguageType();
+ sal_Int16 nLang = LinguLocaleToLanguage( rLocale );
// postprocess result for errors that should be ignored
const bool bIgnoreError =
(!rHelper.IsSpellUpperCase() && IsUpper( rWord, nLang )) ||
@@ -418,7 +418,7 @@ Reference< XSpellAlternatives >
if (n)
{
- sal_Int16 nLang = LanguageTag( rLocale ).getLanguageType();
+ sal_Int16 nLang = LinguLocaleToLanguage( rLocale );
int numsug = 0;
Sequence< OUString > aStr( 0 );
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index 7f17e22255a1..886f37ad14df 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -308,9 +308,9 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes
sal_Int32 stem = 0;
sal_Int32 stem2 = 0;
- sal_Int16 nLanguage = LanguageTag( rLocale ).getLanguageType();
+ sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale );
- if (nLanguage == LANGUAGE_NONE || rTerm.isEmpty())
+ if (LinguIsUnspecified( nLanguage) || rTerm.isEmpty())
return noMeanings;
if (!hasLocale( rLocale ))