Bug 1265126 - fix printing of compose window and special tabs by using PrintUtils.printWindow(). r=jorgk a=rkent THUNDERBIRD452b1_2016051723_RELBRANCH
authoraceman <acelists@atlas.sk>
Sat, 16 Apr 2016 11:18:00 +0200
branchTHUNDERBIRD452b1_2016051723_RELBRANCH
changeset 24594 05269e463635fd266322f19d481c18a98b157516
parent 24593 7c4e2f0b94c77553374438a91e826996fdc2cdf9
child 24595 38bd93a68e668d92b9dd80f5893ba2284bbff4a5
push id1641
push userkent@caspia.com
push dateWed, 18 May 2016 07:34:32 +0000
treeherdercomm-beta@3d73a3597a7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, rkent
bugs1265126
Bug 1265126 - fix printing of compose window and special tabs by using PrintUtils.printWindow(). r=jorgk a=rkent
mail/base/content/specialTabs.js
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -420,17 +420,18 @@ var contentTabBaseType = {
         break;
       case "cmd_findPrevious":
         aTab.findbar.onFindAgainCommand(true);
         break;
       case "cmd_printSetup":
         PrintUtils.showPageSetup();
         break;
       case "cmd_print":
-        PrintUtils.print();
+        let browser = this.getBrowser(aTab);
+        PrintUtils.printWindow(browser.outerWindowID, browser);
         break;
       // XXX print preview not currently supported - bug 497994 to implement.
       //case "cmd_printpreview":
       //  PrintUtils.printPreview();
       //  break;
       case "cmd_stop":
         aTab.browser.stop();
         break;
@@ -1143,17 +1144,18 @@ var specialTabs = {
           break;
         case "cmd_fullZoomToggle":
           ZoomManager.toggleZoom();
           break;
         case "cmd_printSetup":
           PrintUtils.showPageSetup();
           break;
         case "cmd_print":
-          PrintUtils.print();
+          let browser = this.getBrowser(aTab);
+          PrintUtils.printWindow(browser.outerWindowID, browser);
           break;
         // XXX print preview not currently supported - bug 497994 to implement.
         //case "cmd_printpreview":
         //  PrintUtils.printPreview();
         //  break;
       }
     },
     getBrowser: function getBrowser(aTab) {
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -1688,17 +1688,18 @@ function DoCommandClose()
   }
 
   return false;
 }
 
 function DoCommandPrint()
 {
   try {
-    PrintUtils.print();
+    let editor = GetCurrentEditorElement();
+    PrintUtils.printWindow(editor.outerWindowID, editor);
   } catch(ex) {dump("#PRINT ERROR: " + ex + "\n");}
 }
 
 function DoCommandPrintPreview()
 {
   try {
     PrintUtils.printPreview(PrintPreviewListener);
     } catch(ex) { Components.utils.reportError(ex); }