rem: var node = document.getElementById(column);  if ( node ) { var selectionArray = RememberResultsTreeSelection(); if (selectionArray.length) { xulSortService.Sort(node, key, direction); ClearResultsTreeSelection()	; WaitUntilDocumentIsLoaded(); RestoreResultsTreeSelection(selectionArray); } else { try { xulSortService.Sort(node, key, direction); WaitUntilDocumentIsLoaded(); } catch (ex) { dump("failed to do sort\n"); } } } 
add: var node = document.getElementById(column);  if (node) { var selectionArray = RememberResultsTreeSelection(); if (selectionArray.length) { xulSortService.Sort(node, key, direction); ClearResultsTreeSelection(); WaitUntilDocumentIsLoaded(); RestoreResultsTreeSelection(selectionArray); } else { try { xulSortService.Sort(node, key, direction); WaitUntilDocumentIsLoaded(); } catch(ex) { dump("failed to do sort\n"); } } } return true; 
context: function DoSort(column, key, direction){	var isupports = Components.classes["@mozilla.org/rdf/xul-sort-service;1"].getService();	if (!isupports)    return(false);		var xulSortService = isupports.QueryInterface(Components.interfaces.nsIXULSortService);	if (!xulSortService)    return(false);	var node = document.getElementById(column);		if ( node )	{		var selectionArray = RememberResultsTreeSelection();		if (selectionArray.length)		{			xulSortService.Sort(node, key, direction);			ClearResultsTreeSelection()	;			WaitUntilDocumentIsLoaded();			RestoreResultsTreeSelection(selectionArray);		}		else 		{			try {				xulSortService.Sort(node, key, direction);				WaitUntilDocumentIsLoaded();			}			catch (ex) {				dump("failed to do sort\n");			}			}	}}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/58b434774d12e4f60b581145e7f533dbb7857853/abCommon.js/buggy/mailnews/addrbook/resources/content/abCommon.js