Bug 1492051 - Port bug 1491588: replace XPCOM creation of nsICommandParams with Cu.createCommandParams(). rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Tue, 18 Sep 2018 12:53:49 +0200
changeset 33177 5d2710bb0b4e33787c9ff135ce472c7af6e5177a
parent 33176 03d79b0cf04825ec9cd17a9d254df09f74bf1e71
child 33178 b656dcc776f99be78749d34ff1b6bcbc2a129762
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersbustage-fix
bugs1492051, 1491588
Bug 1492051 - Port bug 1491588: replace XPCOM creation of nsICommandParams with Cu.createCommandParams(). rs=bustage-fix
editor/ui/composer/content/editorUtilities.js
mail/base/content/utilityOverlay.js
suite/base/content/utilityOverlay.js
--- a/editor/ui/composer/content/editorUtilities.js
+++ b/editor/ui/composer/content/editorUtilities.js
@@ -297,17 +297,17 @@ function IsHTMLSourceChanged()
 {
   // gSourceTextEditor will not be defined if we're just a text editor.
   return gSourceTextEditor ? gSourceTextEditor.documentModified : false;
 }
 
 function newCommandParams()
 {
   try {
-    return Cc["@mozilla.org/embedcomp/command-params;1"].createInstance(Ci.nsICommandParams);
+    return Cu.createCommandParams();
   }
   catch(e) { dump("error thrown in newCommandParams: "+e+"\n"); }
   return null;
 }
 
 /************* General editing command utilities ***************/
 
 function GetDocumentTitle()
--- a/mail/base/content/utilityOverlay.js
+++ b/mail/base/content/utilityOverlay.js
@@ -50,18 +50,17 @@ function goUpdatePasteMenuItems()
 function goCopyImage() {
   let img = document.popupNode;
   if (/^(https?|data):/i.test(img.src)) {
     goDoCommand("cmd_copyImage");
     return;
   }
   // A mailbox/imap URL then... copy only data then since the HTML data is
   // not that useful for pasting when the image won't be resolved.
-  let param = Cc["@mozilla.org/embedcomp/command-params;1"]
-                .createInstance(Ci.nsICommandParams);
+  let param = Cu.createCommandParams();
   param.setLongValue("imageCopy",
                      Ci.nsIContentViewerEdit.COPY_IMAGE_DATA);
   document.commandDispatcher.getControllerForCommand("cmd_copyImage")
           .QueryInterface(Ci.nsICommandController)
           .doCommandWithParams("cmd_copyImage", param);
 }
 
 // update Find As You Type menu items, they rely on focus
--- a/suite/base/content/utilityOverlay.js
+++ b/suite/base/content/utilityOverlay.js
@@ -1935,18 +1935,17 @@ function GetFileFromString(aString)
                       .createInstance(Ci.nsICommandLine);
   let uri = commandLine.resolveURI(aString);
   return uri instanceof Ci.nsIFileURL ?
          uri.file.QueryInterface(Ci.nsIFile) : null;
 }
 
 function CopyImage()
 {
-  var param = Cc["@mozilla.org/embedcomp/command-params;1"]
-                .createInstance(Ci.nsICommandParams);
+  var param = Cu.createCommandParams();
   param.setLongValue("imageCopy",
                      Ci.nsIContentViewerEdit.COPY_IMAGE_ALL);
   document.commandDispatcher.getControllerForCommand("cmd_copyImage")
           .QueryInterface(Ci.nsICommandController)
           .doCommandWithParams("cmd_copyImage", param);
 }
 
 /**