diff options
author | Eike Rathke <erack@redhat.com> | 2013-01-09 16:48:52 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-01-09 16:59:47 +0100 |
commit | 241ccc2568dd685d224f8a2b051c3e3a018d9400 (patch) | |
tree | da12883cfc55e669e9fff14452b74c1825f4eff3 /lingucomponent | |
parent | a0bf71323741c5c58b77651fe656c73419dbf09f (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 'lingucomponent')
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 9bbddae2f85e..749c61571793 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx @@ -479,13 +479,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); } } @@ -536,7 +536,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 >() ); } @@ -683,7 +683,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 fd4608ec85af..c4d0a7610b84 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -301,9 +301,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 )) |