Bug 680446 - Printing more than one e-mails at the same time reduces the message content. Multiple selection prints only summary. r=bwinton
authorMark Banner <bugzilla@standard8.plus.com>
Fri, 16 Sep 2011 13:42:00 -0700
changeset 9186 3450e93def8c8c9632387baae7c0d91802924ae1
parent 9185 68c36509612b40ec67c81291bf81ab6bc9aebe77
child 9187 8809beb3c8dd3c2f55acdc16f40248f27c6c5920
push id230
push userbugzilla@standard8.plus.com
push dateTue, 08 Nov 2011 22:55:24 +0000
treeherdercomm-beta@63dad5648415 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwinton
bugs680446
Bug 680446 - Printing more than one e-mails at the same time reduces the message content. Multiple selection prints only summary. r=bwinton
mail/base/content/mail3PaneWindowCommands.js
mail/base/content/mailWindowOverlay.js
--- a/mail/base/content/mail3PaneWindowCommands.js
+++ b/mail/base/content/mail3PaneWindowCommands.js
@@ -334,16 +334,17 @@ var DefaultController =
       case "button_replylist":
       case "cmd_forward":
       case "button_forward":
       case "cmd_forwardInline":
       case "cmd_forwardAttachment":
       case "cmd_editAsNew":
       case "cmd_openMessage":
       case "button_print":
+      case "cmd_print":
       case "cmd_viewPageSource":
       case "cmd_reload":
       case "cmd_applyFiltersToSelection":
         let numSelected = GetNumSelectedMessages();
         if (command == "cmd_applyFiltersToSelection")
         {
           var whichText = "valueMessage";
           if (numSelected > 1)
@@ -354,39 +355,34 @@ var DefaultController =
         if (numSelected > 0)
         {
           if (!gFolderDisplay.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody))
             return false;
 
           // Check if we have a collapsed thread selected and are summarizing it.
           // If so, selectedIndices.length won't match numSelected. Also check
           // that we're not displaying a message, which handles the case
-          // where we failed to summarize the selection and fell back to                  // displaying a message.
+          // where we failed to summarize the selection and fell back to
+          // displaying a message.
           if (gFolderDisplay.selectedIndices.length != numSelected &&
               command != "cmd_applyFiltersToSelection" &&
               gDBView && gDBView.currentlyDisplayedMessage == nsMsgViewIndex_None)
             return false;
           if (command == "cmd_reply" || command == "button_reply" ||
               command == "cmd_replyall" ||command == "button_replyall")
             return IsReplyEnabled();
           if (command == "cmd_replylist" || command == "button_replylist")
             return IsReplyListEnabled();
           return true;
         }
         return false;
-      case "cmd_print":
-        // We can print both a single message and a thread summary
-        return (GetNumSelectedMessages() > 0);
       case "cmd_printpreview":
-        if (!gMessageDisplay.singleMessageDisplay)
-          return false;
-        else if (GetNumSelectedMessages() == 1)
+        if (GetNumSelectedMessages() == 1)
           return gFolderDisplay.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody);
-        else
-          return false;
+        return false;
       case "cmd_printSetup":
       case "cmd_viewAllHeader":
       case "cmd_viewNormalHeader":
         return true;
       case "cmd_markAsFlagged":
       case "button_file":
 	return GetNumSelectedMessages() > 0;
       case "cmd_archive":
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -2226,22 +2226,18 @@ function PrintEnginePrintInternal(doPrin
   window.openDialog("chrome://messenger/content/msgPrintEngine.xul", "",
                     "chrome,dialog=no,all,centerscreen",
                     messageList.length, messageList, statusFeedback,
                     doPrintPreview, msgType, window);
 }
 
 function PrintEnginePrint()
 {
-  if (gMessageDisplay.singleMessageDisplay)
-    return PrintEnginePrintInternal(false,
-      Components.interfaces.nsIMsgPrintEngine.MNAB_PRINT_MSG);
-  else
-    return document.getElementById("multimessage")
-      .contentWindow.print();
+  return PrintEnginePrintInternal(false,
+    Components.interfaces.nsIMsgPrintEngine.MNAB_PRINT_MSG);
 }
 
 function PrintEnginePrintPreview()
 {
   return PrintEnginePrintInternal(true,
     Components.interfaces.nsIMsgPrintEngine.MNAB_PRINTPREVIEW_MSG);
 }