Bug 1496053 - Remove unsupported drag region definition from task tree. r=philipp
authorMakeMyDay <makemyday@gmx-topmail.de>
Thu, 15 Nov 2018 13:00:27 +0100
changeset 33721 1a1cb39d41c20a8e8a0c5a3dee4c583c7ef35a04
parent 33720 92b165df282fd74680d765eb421ae89648c0731f
child 33722 465c90ec3466efeac4e52f3696d889069f23ca2a
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersphilipp
bugs1496053
Bug 1496053 - Remove unsupported drag region definition from task tree. r=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>