rem: var threadTree = GetThreadTree();   if(gNextMessageViewIndexAfterDelete != -1) { 
add: if (IsCurrentLoadedFolder(folder)) { if (gNextMessageViewIndexAfterDelete != -1) { 
context: function HandleDeleteOrMoveMsgCompleted(folder){	var threadTree = GetThreadTree();//	if(IsCurrentLoadedFolder(folder)) ### rewrite/implement this//	{		if(gNextMessageViewIndexAfterDelete != -1)		{      var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView);      var outlinerSelection = outlinerView.selection;      viewSize = outlinerView.rowCount;      dump("view size = " + viewSize + "\n");      if (gNextMessageViewIndexAfterDelete >= viewSize)      {        if (viewSize > 0)          gNextMessageViewIndexAfterDelete = viewSize - 1;        else          gNextMessageViewIndexAfterDelete = -1;      }            // if we are about to set the selection with a new element then DON'T clear      // the selection then add the next message to select. This just generates      // an extra round of command updating notifications that we are trying to      // optimize away.      if (gNextMessageViewIndexAfterDelete != -1) {        outlinerSelection.select(gNextMessageViewIndexAfterDelete);        // since gNextMessageViewIndexAfterDelete probably has the same value        // as the last index we had selected, the outliner isn't generating a new        // selectionChanged notification for the outliner view. So we aren't loading the         // next message. to fix this, force the selection changed update.        var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView);        if (outlinerView)          outlinerView.selectionChanged();        EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete);       }      else        outlinerSelection.clearSelection(); /* clear selection in either case  */			gNextMessageViewIndexAfterDelete = -1;		}/*		//if there's nothing to select then see if the tree has any messages.		//if not, then clear the message pane.		else		{			var tree = GetThreadTree();//			var topmost = msgNavigationService.FindFirstMessage(tree);			if(!topmost)				ClearMessagePane()		}//	}    if (gBatching) {      gBatching = false;      //threadTree.treeBoxObject.endBatch();      //dump("XXX end tree batch (delete or move succeeded)\n");    }*/}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/c2ebcb24dbdfbe29746cefcdeb69a92c33535f29/msgMail3PaneWindow.js/buggy/mailnews/base/resources/content/msgMail3PaneWindow.js