if (res1 && !sortInfo->naturalOrderSort) { nsCOMPtr<nsIRDFResource>  modSortRes;
nsIRDFResource *res1 = contentSortInfo->resource;
XULSortServiceImpl::GetResourceValue(nsIRDFResource *res1, sortPtr sortInfo,                                     PRBool first, PRBool useCache,                                     PRBool onlyCollationHint, nsIRDFNode **target, PRBool &isCollationKey){  nsresult rv = NS_OK;  *target = nsnull;  isCollationKey = PR_FALSE;  if (res1 && !sortInfo->naturalOrderSort) {    nsCOMPtr<nsIRDFResource>  modSortRes;    // for any given property, first ask the graph for its value with "?collation=true" appended    // to indicate that if there is a collation key available for this value, we want it    modSortRes = (first) ? sortInfo->sortPropertyColl : sortInfo->sortPropertyColl2;    if (modSortRes) {      if (NS_SUCCEEDED(rv = GetCachedTarget(sortInfo, useCache, res1, modSortRes, PR_TRUE, target))          && (rv != NS_RDF_NO_VALUE))      {        isCollationKey = PR_TRUE;      }    }    if (!*target && !onlyCollationHint) {      // if no collation key, ask the graph for its value with "?sort=true" appended      // to indicate that if there is any distinction between its display value and sorting      // value, we want the sorting value (so that, for example, a mail datasource could strip      // off a "Re:" on a mail message subject)      modSortRes = first ? sortInfo->sortPropertySort : sortInfo->sortPropertySort2;      if (modSortRes)        rv = GetCachedTarget(sortInfo, useCache, res1, modSortRes, PR_TRUE, target);    }    if (!*target && !onlyCollationHint) {      // if no collation key and no special sorting value, just get the property value      modSortRes = first ? sortInfo->sortProperty : sortInfo->sortProperty2;      if (modSortRes)        rv = GetCachedTarget(sortInfo, useCache, res1, modSortRes, PR_TRUE, target);    }  }    return rv;}