rem: if (selectedNumber>=0) { 
add: if (selectedNumber>=0 && updateSelection) { 
context: function SortTree(tree, view, table, column, lastSortColumn, lastSortAscending) {  // remember which item was selected so we can restore it after the sort  var selections = GetTreeSelections(tree);  var selectedNumber = selections.length ? table[selections[0]].number : -1;  // determine if sort is to be ascending or descending  var ascending = (column == lastSortColumn) ? !lastSortAscending : true;  // do the sort  var compareFunc;  if (ascending) {    compareFunc = function compare(first, second) {      if (first[column] < second[column])        return -1;      if (first[column] > second[column])        return 1;      return 0;    }  } else {    compareFunc = function compare(first, second) {      if (first[column] < second[column])        return 1;      if (first[column] > second[column])        return -1;      return 0;    }  }  table.sort(compareFunc);  // restore the selection  var selectedRow = -1;  if (selectedNumber>=0) {    for (var s=0; s<table.length; s++) {      if (table[s].number == selectedNumber) {        // update selection        // note: we need to deselect before reselecting in order to trigger ...Selected()        tree.treeBoxObject.view.selection.select(-1);        tree.treeBoxObject.view.selection.select(s);        selectedRow = s;        break;      }    }  }  // display the results  tree.treeBoxObject.invalidate();  if (selectedRow>0) {    tree.treeBoxObject.ensureRowIsVisible(selectedRow)  }  return ascending;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/8a469e6707c1ef0dc6dd0763d663c997f50176ad/treeUtils.js/buggy/suite/common/permissions/treeUtils.js