rem: var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; viewSize = treeView.rowCount; 
add: var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; var viewSize = treeView.rowCount; 
context: function HandleDeleteOrMoveMessageCompleted(folder){        var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView);        var treeSelection = treeView.selection;        viewSize = treeView.rowCount;        if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize)        {            if (viewSize > 0)                gNextMessageViewIndexAfterDelete = viewSize - 1;            else            {                gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None;                //clear the selection                treeSelection.clearSelection();            }        }        // 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 != nsMsgViewIndex_None) {            treeSelection.select(gNextMessageViewIndexAfterDelete);            // since gNextMessageViewIndexAfterDelete probably has the same value            // as the last index we had selected, the tree isn't generating a new            // selectionChanged notification for the tree view. So we aren't loading the             // next message. to fix this, force the selection changed update.            if (treeView)                treeView.selectionChanged();            EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete);         }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/bdb14cf763fd88fae2716f3e80e9a50633f984c9/SearchDialog.js/clean/mailnews/base/search/resources/content/SearchDialog.js