Bug 1071771, disable dictionary list when it cannot be accessed from another process. This makes the context menu work again after using it on a misspelled word, r=mconley

This commit is contained in:
Neil Deakin 2014-09-30 12:05:53 -04:00
parent 172c321d53
commit 424e165e6b
2 changed files with 7 additions and 1 deletions

View File

@ -384,7 +384,8 @@ nsContextMenu.prototype = {
if (canSpell) {
var dictMenu = document.getElementById("spell-dictionaries-menu");
var dictSep = document.getElementById("spell-language-separator");
InlineSpellCheckerUI.addDictionaryListToMenu(dictMenu, dictSep);
let count = InlineSpellCheckerUI.addDictionaryListToMenu(dictMenu, dictSep);
this.showItem(dictSep, count > 0);
this.showItem("spell-add-dictionaries-main", false);
}
else if (this.onEditableArea) {

View File

@ -159,6 +159,11 @@ InlineSpellChecker.prototype = {
if (! this.mInlineSpellChecker || ! this.enabled)
return 0;
var spellchecker = this.mInlineSpellChecker.spellChecker;
// Cannot access the dictionary list from another process so just return 0.
if (Components.utils.isCrossProcessWrapper(spellchecker))
return 0;
var o1 = {}, o2 = {};
spellchecker.GetDictionaryList(o1, o2);
var list = o1.value;