diff --git a/editor/composer/nsEditorSpellCheck.cpp b/editor/composer/nsEditorSpellCheck.cpp index f2df1addf10..a4b665a7675 100644 --- a/editor/composer/nsEditorSpellCheck.cpp +++ b/editor/composer/nsEditorSpellCheck.cpp @@ -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 diff --git a/toolkit/modules/InlineSpellChecker.jsm b/toolkit/modules/InlineSpellChecker.jsm index 8090f7d28c1..917ea056158 100644 --- a/toolkit/modules/InlineSpellChecker.jsm +++ b/toolkit/modules/InlineSpellChecker.jsm @@ -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