rem: nsMsgViewSortType.byThread, nsMsgViewSortOrder.ascending); 
add: nsMsgViewSortType.byThread, oldSortOrder); 
context: function SwitchView(command){  var oldSortType = gDBView ? gDBView.sortType : nsMsgViewSortType.byThread;  var oldSortOrder = gDBView ? gDBView.sortOrder : nsMsgViewSortOrder.ascending;  var viewFlags = gCurViewFlags;  // close existing view.  if (gDBView) {    gDBView.close();    gDBView = null;   }  switch(command)  {    case "cmd_viewUnreadMsgs":      viewFlags = viewFlags | nsMsgViewFlagsType.kUnreadOnly;      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowAllThreads, viewFlags,            oldSortType, oldSortOrder );    break;    case "cmd_viewAllMsgs":      viewFlags = viewFlags & ~nsMsgViewFlagsType.kUnreadOnly;      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowAllThreads, viewFlags,            oldSortType, oldSortOrder);    break;    case "cmd_viewThreadsWithUnread":      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowThreadsWithUnread, nsMsgViewFlagsType.kThreadedDisplay,            nsMsgViewSortType.byThread, nsMsgViewSortOrder.ascending);    break;    case "cmd_viewWatchedThreadsWithUnread":      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowWatchedThreadsWithUnread, nsMsgViewFlagsType.kThreadedDisplay,            nsMsgViewSortType.byThread, nsMsgViewSortOrder.ascending);   break;    case "cmd_viewIgnoredThreads":      if (viewFlags & nsMsgViewFlagsType.kShowIgnored)        viewFlags = viewFlags & ~nsMsgViewFlagsType.kShowIgnored;      else        viewFlags = viewFlags | nsMsgViewFlagsType.kShowIgnored;      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowAllThreads, viewFlags,            nsMsgViewSortType.byThread, nsMsgViewSortOrder.ascending);    break;  }  // that should have initialized gDBView, now re-root the thread pane  var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView);  if (outlinerView)  {    var outliner = GetThreadOutliner();    outliner.boxObject.QueryInterface(Components.interfaces.nsIOutlinerBoxObject).view = outlinerView;  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/fd80a593b263c8b61bfafae29bd861350ff6a25f/commandglue.js/buggy/mailnews/base/resources/content/commandglue.js