rem: if ( dataObj )  dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString); 
add: if ( dataObj )  dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString); 
context: function DropOnTree ( event ){  if ( !gDragDropEnabled )    return;      var RDF =     Components.classes["component://netscape/rdf/rdf-service"].getService(Components.interfaces.nsIRDFService);  if (!RDF) return(false);  var RDFC =    Components.classes["component://netscape/rdf/container"].getService(Components.interfaces.nsIRDFContainer);  if (!RDFC)  return(false);  var Bookmarks = RDF.GetDataSource("rdf:bookmarks");  if (!Bookmarks) return(false);  var treeRoot = document.getElementById("bookmarksTree");  if (!treeRoot)  return(false);  var treeDatabase = treeRoot.database;  if (!treeDatabase)  return(false);  // target is the <treecell>, and "id" is on the <treeitem> two levels above  var treeItem = event.target.parentNode.parentNode;  if (!treeItem)  return(false);  var targetID = getAbsoluteID(treeRoot, treeItem);  if (!targetID)  return(false);  var targetNode = RDF.GetResource(targetID, true);  if (!targetNode)  return(false);  // get drop hint attributes  var dropBefore = treeItem.getAttribute("dd-droplocation");  var dropOn = treeItem.getAttribute("dd-dropon");  // calculate drop action  var dropAction;  if (dropBefore == "true") dropAction = "before";  else if (dropOn == "true")  dropAction = "on";  else        dropAction = "after";  // calculate parent container node  var containerItem = treeItem;  if (dropAction != "on")    containerItem = treeItem.parentNode.parentNode;  var containerID = getAbsoluteID(treeRoot, containerItem);  if (!containerID) return(false);  var containerNode = RDF.GetResource(containerID);  if (!containerNode) return(false);  var dragService =     Components.classes["component://netscape/widget/dragservice"].getService(Components.interfaces.nsIDragService);  if ( !dragService ) return(false);    var dragSession = dragService.getCurrentSession();  if ( !dragSession ) return(false);  var trans =     Components.classes["component://netscape/widget/transferable"].createInstance(Components.interfaces.nsITransferable);  if ( !trans )   return(false);  trans.addDataFlavor("text/plain");  var dirty = false;  for ( var i = 0; i < dragSession.numDropItems; ++i )  {    dragSession.getData ( trans, i );    var dataObj = new Object();    var bestFlavor = new Object();    var len = new Object();    trans.getAnyTransferData ( bestFlavor, dataObj, len );    if ( dataObj )  dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString);    if ( !dataObj ) continue;    // pull the URL out of the data object    var sourceID = dataObj.data.substring(0, len.value);    if (!sourceID)  continue;    debug("    Node #" + i + ": drop '" + sourceID + "' " + dropAction + " '" + targetID + "'");    var sourceNode = RDF.GetResource(sourceID, true);    if (!sourceNode)  continue;        // Prevent dropping of a node before, after, or on itself    if (sourceNode == targetNode) continue;    RDFC.Init(Bookmarks, containerNode);    if ((dropAction == "before") || (dropAction == "after"))    {      // drop before or after      var nodeIndex;      nodeIndex = RDFC.IndexOf(sourceNode);      if (nodeIndex >= 1)      {        // moving a node around inside of the container        // so remove, then re-add the node        RDFC.RemoveElementAt(nodeIndex, true, sourceNode);      }            nodeIndex = RDFC.IndexOf(targetNode);      if (nodeIndex < 1)  return(false);      if (dropAction == "after")  ++nodeIndex;      RDFC.InsertElementAt(sourceNode, nodeIndex, true);      dirty = true;    }    else    {      // drop on      RDFC.AppendElement(sourceNode);      dirty = true;    }  }  if (dirty == true)  {    var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);    if (remote)    {      remote.Flush();      debug("Wrote out bookmark changes.");    }  }  return(false);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/02674553b8757624eef860e044717bd63037191a/bookmarksDD.js/clean/xpfe/components/bookmarks/resources/bookmarksDD.js