Backed out changeset 02fbb6ada9cb (bug 967494) for build bustage on a CLOSED TREE

This commit is contained in:
Ehsan Akhgari 2014-09-10 18:29:34 -04:00
parent 5863949c0c
commit c1678608c7
2 changed files with 17 additions and 28 deletions

View File

@ -738,33 +738,27 @@ nsEditorSpellCheck::DictionaryFetched(DictionaryFetcher* aFetcher)
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;
uint32_t flags;
mEditor->GetFlags(&flags);
// Don't use the content pref when writing mail
if (!(flags & nsIPlaintextEditor::eEditorMailMask)) {
mPreferredLang.Assign(aFetcher->mRootContentLang);
// 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;
dictName.Assign(aFetcher->mDictionary);
if (!dictName.IsEmpty()) {
if (NS_FAILED(SetCurrentDictionary(dictName))) {
// may be dictionary was uninstalled ?
ClearCurrentDictionary(mEditor);
}
return NS_OK;
}
if (mPreferredLang.IsEmpty()) {
mPreferredLang.Assign(aFetcher->mRootDocContentLang);
}
if (mPreferredLang.IsEmpty()) {
mPreferredLang.Assign(aFetcher->mRootDocContentLang);
}
// Then, try to use language computed from element
if (!mPreferredLang.IsEmpty()) {
dictName.Assign(mPreferredLang);
}
// Then, try to use language computed from element
if (!mPreferredLang.IsEmpty()) {
dictName.Assign(mPreferredLang);
}
// otherwise, get language from preferences

View File

@ -295,11 +295,6 @@ InlineSpellChecker.prototype = {
var spellchecker = this.mInlineSpellChecker.spellChecker;
spellchecker.SetCurrentDictionary(this.mDictionaryNames[index]);
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