rem: var datasource = this.getOutlinerBody().database; 
add: var datasource = this.getOutliner().database; 
context: function nsOutlinerController_delete(){    var rangeCount = this.getOutlinerSelection().getRangeCount();  if (rangeCount < 1)    return false;        if (!gRDFC)    gRDFC = Components.classes[rdfc_contractid].getService(nsIRDFContainer);  var datasource = this.getOutlinerBody().database;  var min = new Object();   var max = new Object();  var dirty = false;  for (var i = rangeCount - 1; i >= 0; --i) {    this.getOutlinerSelection().getRangeAt(i, min, max);    for (var k = max.value; k >= min.value; --k) {      var url = this.getOutlinerView().getCellText(k, "URL");      if (!url)        continue;              if (!gRDF)        gRDF = Components.classes[rdf_contractid].getService(Components.interfaces.nsIRDFService);      var IDRes = gRDF.GetResource(url);      if (!IDRes)        continue;      var root = this.getOutlinerBody().getAttribute('ref');      var parentIDRes = gRDF.GetResource(root);      if (!parentIDRes)        continue;            // XXX - This should not be necessary      // Why doesn't the unassertion fan out to all of the datasources in      // the nsIRDFCompositeDataSource so they can handle it?      var dsEnum = datasource.GetDataSources();         while (dsEnum.hasMoreElements()) {        var ds = dsEnum.getNext().QueryInterface(Components.interfaces.nsIRDFDataSource);        try {          // try a container-based approach          gRDFC.Init(ds, parentIDRes);          gRDFC.RemoveElement(IDRes, true);        } catch (ex) {          // otherwise remove the parent/child assertion then          var containment = gRDF.GetResource("http://home.netscape.com/NC-rdf#child");          ds.Unassert(parentIDRes, containment, IDRes);        }        dirty = true;      }    }  }  if (dirty) {        try {      var remote = datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);      remote.Flush();    } catch (ex) {    }  }  if (max.value) {    var newIndex = max.value - (max.value - min.value);    if (newIndex >= this.getOutlinerView().rowCount)      --newIndex;    this.getOutlinerSelection().select(newIndex);  }  return true;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/bbc83df10641adba9169bedcdf352be6ea5f601d/nsOutlinerController.js/buggy/xpfe/global/resources/content/nsOutlinerController.js