Bug 1556925 - C-C part: Adapt to array changes in mozISpellCheckingEngine.getDictionaryList. r=jorgk

This commit is contained in:
Boris Zbarsky 2019-06-04 21:13:00 +02:00
Родитель a3d4d1f627
Коммит c238f5bee5
6 изменённых файлов: 11 добавлений и 32 удалений

Просмотреть файл

@ -144,10 +144,7 @@ Extractor.prototype = {
let spellchecker = Cc["@mozilla.org/spellchecker/engine;1"]
.getService(Ci.mozISpellCheckingEngine);
let arr = {};
let cnt = {};
spellchecker.getDictionaryList(arr, cnt);
let dicts = arr.value;
let dicts = spellchecker.getDictionaryList();
if (dicts.length == 0) {
cal.LOG("[calExtract] There are no dictionaries installed and " +

Просмотреть файл

@ -2348,11 +2348,9 @@ function getValidSpellcheckerDictionary(draftLanguage) {
let prefValue = Services.prefs.getCharPref("spellchecker.dictionary");
let spellChecker = Cc["@mozilla.org/spellchecker/engine;1"]
.getService(Ci.mozISpellCheckingEngine);
let o1 = {};
let o2 = {};
spellChecker.getDictionaryList(o1, o2);
let dictList = o1.value;
let count = o2.value;
let dictList = spellChecker.getDictionaryList();
let count = dictList.length;
if (count == 0) {
// If there are no dictionaries, we can't check the value, so return it.

Просмотреть файл

@ -185,16 +185,12 @@ var gComposePane = {
initLanguageMenu() {
var languageMenuList = document.getElementById("languageMenuList");
this.mSpellChecker = Cc["@mozilla.org/spellchecker/engine;1"].getService(Ci.mozISpellCheckingEngine);
var o1 = {};
var o2 = {};
// Get the list of dictionaries from
// the spellchecker.
this.mSpellChecker.getDictionaryList(o1, o2);
var dictList = o1.value;
var count = o2.value;
var dictList = this.mSpellChecker.getDictionaryList();
var count = dictList.length;
// if we don't have any dictionaries installed, disable the menu list
languageMenuList.disabled = !count;

Просмотреть файл

@ -1162,9 +1162,7 @@ SuiteGlue.prototype = {
var spellChecker = Cc["@mozilla.org/spellchecker/engine;1"]
.getService(Ci.mozISpellCheckingEngine);
var o1 = {};
spellChecker.getDictionaryList(o1, {});
var dictList = o1.value;
var dictList = spellChecker.getDictionaryList();
// If the preference contains an invalid dictionary, set it to a valid
// dictionary, any dictionary will do.
if (dictList.length && dictList.indexOf(prefValue) < 0)

Просмотреть файл

@ -21,14 +21,9 @@ function InitLanguageMenu() {
var spellChecker = Cc["@mozilla.org/spellchecker/engine;1"]
.getService(Ci.mozISpellCheckingEngine);
var o1 = {};
var o2 = {};
// Get the list of dictionaries from the spellchecker.
spellChecker.getDictionaryList(o1, o2);
var dictList = o1.value;
var count = o2.value;
var dictList = spellChecker.getDictionaryList();
var count = dictList.length;
// If dictionary count hasn't changed then no need to update the menu.
if (gDictCount == count)

Просмотреть файл

@ -2056,14 +2056,9 @@ function InitLanguageMenu()
var spellChecker = Cc["@mozilla.org/spellchecker/engine;1"]
.getService(mozISpellCheckingEngine);
var o1 = {};
var o2 = {};
// Get the list of dictionaries from the spellchecker.
spellChecker.getDictionaryList(o1, o2);
var dictList = o1.value;
var count = o2.value;
var dictList = spellChecker.getDictionaryList();
var count = dictList.length;
// If dictionary count hasn't changed then no need to update the menu.
if (sDictCount == count)