Bug 1496053 - Remove unsupported drag region definition from task tree. r+a=philipp
authorMakeMyDay <makemyday@gmx-topmail.de>
Thu, 15 Nov 2018 13:00:27 +0100
changeset 33498 d014d162075c10c75b787857a1a9cfcf624697fd
parent 33497 228ff50ccd3184b68efb8b26206d659b649bb6ea
child 33499 c4aca7ee59e8825d301e7e37a71609c5e6ba8f47
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
bugs1496053
Bug 1496053 - Remove unsupported drag region definition from task tree. r+a=philipp
calendar/base/content/calendar-task-tree.xml
--- a/calendar/base/content/calendar-task-tree.xml
+++ b/calendar/base/content/calendar-task-tree.xml
@@ -1107,49 +1107,16 @@
           if (event.originalTarget.localName != "treechildren") {
               // We should only drag treechildren, not for example the scrollbar.
               return;
           }
           let item = this.mTreeView._getItemFromEvent(event);
           if (!item || item.calendar.readOnly) {
               return;
           }
-
-          let tree = document.getAnonymousElementByAttribute(this, "anonid", "calendar-task-tree");
-
-          // let's build the drag region
-          let region = null;
-          try {
-              region = Components.classes["@mozilla.org/gfx/region;1"].createInstance(Components.interfaces.nsIScriptableRegion);
-              region.init();
-              let treeBox = tree.treeBox;
-              let bodyBox = treeBox.treeBody.boxObject;
-              let sel = tree.view.selection;
-
-              let rowX = bodyBox.x;
-              let rowY = bodyBox.y;
-              let rowHeight = treeBox.rowHeight;
-              let rowWidth = bodyBox.width;
-
-              // add a rectangle for each visible selected row
-              for (let i = treeBox.getFirstVisibleRow(); i <= treeBox.getLastVisibleRow(); i++) {
-                  if (sel.isSelected(i)) {
-                      region.unionRect(rowX, rowY, rowWidth, rowHeight);
-                  }
-                  rowY = rowY + rowHeight;
-              }
-
-              // and finally, clip the result to be sure we don't spill over...
-              if (!region.isEmpty()) {
-                  region.intersectRect(bodyBox.x, bodyBox.y, bodyBox.width, bodyBox.height);
-              }
-          } catch (ex) {
-              cal.ASSERT(false, "Error while building selection region: " + ex + "\n");
-              region = null;
-          }
           invokeEventDragSession(item, event.target);
       ]]></handler>
     </handlers>
 
   </binding>
 
   <binding id="calendar-task-tree-todaypane" extends="chrome://calendar/content/calendar-task-tree.xml#calendar-task-tree">
     <implementation>