dir = NS_LITERAL_STRING("natural");
dir.AssignLiteral("natural");
nsXULTreeBuilder::Sort(nsIDOMElement* aElement){    nsCOMPtr<nsIContent> header = do_QueryInterface(aElement);    if (! header)        return NS_ERROR_FAILURE;    nsAutoString sortLocked;    header->GetAttr(kNameSpaceID_None, nsXULAtoms::sortLocked, sortLocked);    if (sortLocked.EqualsLiteral("true"))        return NS_OK;    nsAutoString sort;    header->GetAttr(kNameSpaceID_None, nsXULAtoms::sort, sort);    if (sort.IsEmpty())        return NS_OK;    // Grab the new sort variable    mSortVariable = mRules.LookupSymbol(sort.get());    // Cycle the sort direction    nsAutoString dir;    header->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, dir);    if (dir.EqualsLiteral("ascending")) {        dir = NS_LITERAL_STRING("descending");        mSortDirection = eDirection_Descending;    }    else if (dir.EqualsLiteral("descending")) {        dir = NS_LITERAL_STRING("natural");        mSortDirection = eDirection_Natural;    }    else {        dir = NS_LITERAL_STRING("ascending");        mSortDirection = eDirection_Ascending;    }    // Sort it.    SortSubtree(mRows.GetRoot());    mRows.InvalidateCachedRow();    if (mBoxObject)         mBoxObject->Invalidate();    nsTreeUtils::UpdateSortIndicators(header, dir);    return NS_OK;}