Bug 1556922 - C-C part: Adapt to array changes in nsIEditorSpellCheck.GetDictionaryList. r=jorgk DONTBUILD
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 05 Jun 2019 11:30:22 +0200
changeset 35776 96ab0ff97ab4901115e88ee8cfb0d02d19c34a89
parent 35775 2be4f664709ce345bf9a06561b6462e509aef9a1
child 35777 4a37dadf68195123ad4e38b39487a64c15f28d18
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersjorgk
bugs1556922
Bug 1556922 - C-C part: Adapt to array changes in nsIEditorSpellCheck.GetDictionaryList. r=jorgk DONTBUILD
editor/ui/dialogs/content/EdSpellCheck.js
--- a/editor/ui/dialogs/content/EdSpellCheck.js
+++ b/editor/ui/dialogs/content/EdSpellCheck.js
@@ -101,39 +101,34 @@ function spellCheckStarted() {
   //  no misspelled word is found
   //  (different message when used for the first time)
   gFirstTime = false;
 
   window.sizeToContent();
 }
 
 function InitLanguageMenu(aCurLang) {
-  var o1 = {};
-  var o2 = {};
-
   // Get the list of dictionaries from
   // the spellchecker.
 
+  var dictList;
   try {
-    gSpellChecker.GetDictionaryList(o1, o2);
+    dictList = gSpellChecker.GetDictionaryList();
   } catch (ex) {
     dump("Failed to get DictionaryList!\n");
     return;
   }
 
-  var dictList = o1.value;
-  var count    = o2.value;
-
   // If we're not just starting up and dictionary count
   // hasn't changed then no need to update the menu.
-  if (gDictCount == count)
+  if (gDictCount == dictList.length)
     return;
 
   // Store current dictionary count.
-  gDictCount = count;
+  gDictCount = dictList.length;
 
   var inlineSpellChecker = new InlineSpellChecker();
   var sortedList = inlineSpellChecker.sortDictionaryList(dictList);
 
   // Remove any languages from the list.
   var languageMenuPopup = gDialog.LanguageMenulist.menupopup;
   while (languageMenuPopup.firstChild.localName != "menuseparator")
     languageMenuPopup.firstChild.remove();