Bug 1489788 - Port Bug 1489787: replace XPCOM use of nsComposeTxtSrvFilter. r=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 10 Sep 2018 22:36:27 +1200
changeset 33116 5b512cb296c7a8b087ab94a24801c991e0d2fbad
parent 33115 9e4a6da09ad841d6dc7f6d4265b6e905d87e718b
child 33117 cacb2b5c2373484ecbf434c126e55750c8b2d993
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersjorgk
bugs1489788, 1489787
Bug 1489788 - Port Bug 1489787: replace XPCOM use of nsComposeTxtSrvFilter. r=jorgk
editor/ui/dialogs/content/EdSpellCheck.js
--- a/editor/ui/dialogs/content/EdSpellCheck.js
+++ b/editor/ui/dialogs/content/EdSpellCheck.js
@@ -28,32 +28,25 @@ function Startup()
   {
     dump("SpellChecker not found!!!\n");
     window.close();
     return;
   }
 
   // Start the spell checker module.
   try {
-    // TxtSrv Filter Contract Id
-    var filterContractId;
     var skipBlockQuotes = window.arguments[1];
     var enableSelectionChecking = window.arguments[2];
 
-    if (skipBlockQuotes)
-      filterContractId = "@mozilla.org/editor/txtsrvfiltermail;1";
-    else
-      filterContractId = "@mozilla.org/editor/txtsrvfilter;1";
-
-    gSpellChecker.setFilter(Cc[filterContractId].createInstance(Ci.nsITextServicesFilter));
+    gSpellChecker.setFilterType(skipBlockQuotes ?
+                                Ci.nsIEditorSpellCheck.FILTERTYPE_MAIL :
+                                Ci.nsIEditorSpellCheck.FILTERTYPE_NORMAL);
     gSpellChecker.InitSpellChecker(editor, enableSelectionChecking, spellCheckStarted);
-
-  }
-  catch(ex) {
-   dump("*** Exception error: InitSpellChecker\n");
+  } catch(ex) {
+    dump("*** Exception error: InitSpellChecker\n");
     window.close();
     return;
   }
 }
 
 function spellCheckStarted() {
   gDialog.MisspelledWordLabel = document.getElementById("MisspelledWordLabel");
   gDialog.MisspelledWord      = document.getElementById("MisspelledWord");