Bug 626607 - Select All on webconsole includes messages that were filtered out; r=dolske a=blocking-final+
authorRob Campbell <rcampbell@mozilla.com>
Thu, 03 Feb 2011 12:06:50 -0500
changeset 61846 ba7090bbf9fe42387f589659f75686517e9f4838
parent 61845 108aec53a28051831834d4f909e1336046c57dcb
child 61847 f1f0bf6fedbbe884eecc2699799c357628286f7f
push id18520
push usereakhgari@mozilla.com
push dateThu, 03 Feb 2011 17:17:51 +0000
treeherderautoland@bc9d7938cdc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, blocking-final
bugs626607
milestone2.0b12pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 626607 - Select All on webconsole includes messages that were filtered out; r=dolske a=blocking-final+
toolkit/components/console/hudservice/HUDService.jsm
--- a/toolkit/components/console/hudservice/HUDService.jsm
+++ b/toolkit/components/console/hudservice/HUDService.jsm
@@ -2846,27 +2846,36 @@ HUD_SERVICE.prototype =
    *        The output node.
    * @returns void
    */
   copySelectedItems: function HS_copySelectedItems(aOutputNode)
   {
     // Gather up the selected items and concatenate their clipboard text.
 
     let strings = [];
+    let newGroup = false;
     for (let i = 0; i < aOutputNode.selectedCount; i++) {
       let item = aOutputNode.selectedItems[i];
 
       // Add newlines between groups so that group boundaries show up in the
       // copied output.
       if (i > 0 && item.classList.contains("webconsole-new-group")) {
-        strings.push("\n");
+        newGroup = true;
       }
 
-      let timestampString = ConsoleUtils.timestampString(item.timestamp);
-      strings.push("[" + timestampString + "] " + item.clipboardText);
+      // Ensure the selected item hasn't been filtered by type or string.
+      if (!item.classList.contains("hud-filtered-by-type") &&
+          !item.classList.contains("hud-filtered-by-string")) {
+        let timestampString = ConsoleUtils.timestampString(item.timestamp);
+        if (newGroup) {
+          strings.push("\n");
+          newGroup = false;
+        }
+        strings.push("[" + timestampString + "] " + item.clipboardText);
+      }
     }
     clipboardHelper.copyString(strings.join("\n"));
   }
 };
 
 //////////////////////////////////////////////////////////////////////////
 // HeadsUpDisplay
 //////////////////////////////////////////////////////////////////////////