else if (LL_CMP(dateVal1, <, dateVal2))	sortOrder = 1;
else if (LL_CMP(dateVal1, >, dateVal2))	sortOrder = 1;
XULSortServiceImpl::CompareNodes(nsIRDFNode *cellNode1, PRBool isCollationKey1,				 nsIRDFNode *cellNode2, PRBool isCollationKey2,				 PRInt32 & sortOrder){	sortOrder = 0;	nsAutoString			cellVal1, cellVal2;	nsCOMPtr<nsIRDFLiteral>		literal1 = do_QueryInterface(cellNode1);	nsCOMPtr<nsIRDFLiteral>		literal2 = do_QueryInterface(cellNode2);	if (literal1)	{		const PRUnichar		*uni1 = nsnull;		literal1->GetValueConst(&uni1);		if (uni1)	cellVal1 = uni1;	}	if (literal2)	{		const PRUnichar		*uni2 = nsnull;		literal2->GetValueConst(&uni2);		if (uni2)	cellVal2 = uni2;	}	if (isCollationKey1 == PR_TRUE && isCollationKey2 == PR_TRUE)	{		// sort collation keys		if (collationService)		{			collationService->CompareSortKey(cellVal1, cellVal2, &sortOrder);		}		else		{			// without a collation service, unable to collate			sortOrder = 0;		}	}	else if ((isCollationKey1 == PR_TRUE) && (isCollationKey2 == PR_FALSE))	{		sortOrder = -1;	}	else if ((isCollationKey1 == PR_FALSE) && (isCollationKey2 == PR_TRUE))	{		sortOrder = 1;	}	else if (literal1 && literal2)	{		// neither is a collation key, but both are strings, so fallback to a string comparison		sortOrder = (PRInt32)cellVal1.Compare(cellVal2, PR_TRUE);	}	else	{		// not a collation key, and both aren't strings, so try other data types (ints)		nsCOMPtr<nsIRDFInt>		intLiteral1 = do_QueryInterface(cellNode1);		nsCOMPtr<nsIRDFInt>		intLiteral2 = do_QueryInterface(cellNode2);		if (intLiteral1 && intLiteral2)		{			PRInt32			intVal1, intVal2;			intLiteral1->GetValue(&intVal1);			intLiteral2->GetValue(&intVal2);						sortOrder = 0;			if (intVal1 < intVal2)		sortOrder = -1;			else if (intVal1 > intVal2)	sortOrder = 1;		}		else		{			// not a collation key, and both aren't strings, so try other data types (dates)			nsCOMPtr<nsIRDFDate>		dateLiteral1 = do_QueryInterface(cellNode1);			nsCOMPtr<nsIRDFDate>		dateLiteral2 = do_QueryInterface(cellNode2);			if (dateLiteral1 && dateLiteral2)			{				PRInt64			dateVal1, dateVal2;				dateLiteral1->GetValue(&dateVal1);				dateLiteral2->GetValue(&dateVal2);								sortOrder = 0;				if (LL_CMP(dateVal1, <, dateVal2))	sortOrder = -1;				else if (LL_CMP(dateVal1, <, dateVal2))	sortOrder = 1;			}		}	}	return(NS_OK);}