mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 02fbb6ada9cb (bug 967494) for build bustage on a CLOSED TREE
This commit is contained in:
parent
5863949c0c
commit
c1678608c7
@ -738,33 +738,27 @@ nsEditorSpellCheck::DictionaryFetched(DictionaryFetcher* aFetcher)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mPreferredLang.Assign(aFetcher->mRootContentLang);
|
||||||
|
|
||||||
|
// If we successfully fetched a dictionary from content prefs, do not go
|
||||||
|
// further. Use this exact dictionary.
|
||||||
nsAutoString dictName;
|
nsAutoString dictName;
|
||||||
uint32_t flags;
|
dictName.Assign(aFetcher->mDictionary);
|
||||||
mEditor->GetFlags(&flags);
|
if (!dictName.IsEmpty()) {
|
||||||
// Don't use the content pref when writing mail
|
if (NS_FAILED(SetCurrentDictionary(dictName))) {
|
||||||
if (!(flags & nsIPlaintextEditor::eEditorMailMask)) {
|
// may be dictionary was uninstalled ?
|
||||||
mPreferredLang.Assign(aFetcher->mRootContentLang);
|
ClearCurrentDictionary(mEditor);
|
||||||
|
|
||||||
// If we successfully fetched a dictionary from content prefs, do not go
|
|
||||||
// further. Use this exact dictionary.
|
|
||||||
nsAutoString dictName;
|
|
||||||
dictName.Assign(aFetcher->mDictionary);
|
|
||||||
if (!dictName.IsEmpty()) {
|
|
||||||
if (NS_FAILED(SetCurrentDictionary(dictName))) {
|
|
||||||
// may be dictionary was uninstalled ?
|
|
||||||
ClearCurrentDictionary(mEditor);
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
if (mPreferredLang.IsEmpty()) {
|
if (mPreferredLang.IsEmpty()) {
|
||||||
mPreferredLang.Assign(aFetcher->mRootDocContentLang);
|
mPreferredLang.Assign(aFetcher->mRootDocContentLang);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then, try to use language computed from element
|
// Then, try to use language computed from element
|
||||||
if (!mPreferredLang.IsEmpty()) {
|
if (!mPreferredLang.IsEmpty()) {
|
||||||
dictName.Assign(mPreferredLang);
|
dictName.Assign(mPreferredLang);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, get language from preferences
|
// otherwise, get language from preferences
|
||||||
|
@ -295,11 +295,6 @@ InlineSpellChecker.prototype = {
|
|||||||
var spellchecker = this.mInlineSpellChecker.spellChecker;
|
var spellchecker = this.mInlineSpellChecker.spellChecker;
|
||||||
spellchecker.SetCurrentDictionary(this.mDictionaryNames[index]);
|
spellchecker.SetCurrentDictionary(this.mDictionaryNames[index]);
|
||||||
this.mInlineSpellChecker.spellCheckRange(null); // causes recheck
|
this.mInlineSpellChecker.spellCheckRange(null); // causes recheck
|
||||||
// Save chosen dictionary to preferences only when writing mail
|
|
||||||
if (this.mEditor.flags & this.mEditor.eEditorMailMask) {
|
|
||||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
|
||||||
Services.prefs.setCharPref("spellchecker.dictionary", this.mDictionaryNames[index]);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// callback for selecting a suggesteed replacement
|
// callback for selecting a suggesteed replacement
|
||||||
|
Loading…
Reference in New Issue
Block a user