else if (!nsCRT::strcmp(cPropName, "card:URI")) { nsCOMPtr<nsIRDFResource> rdfResource (do_QueryInterface(aCard, &retCode)) ; nsXPIDLCString uri;  NS_ENSURE_SUCCESS(retCode, retCode) ; retCode = rdfResource->GetValue(getter_Copies(uri)) ; NS_ENSURE_SUCCESS(retCode, retCode) ; newValue = new nsAbDirectoryQueryPropertyValue(cPropName, NS_ConvertASCIItoUCS2(uri).get()) ; } else {
else {
nsresult FillPropertyValues(nsIAbCard *aCard, nsIAbDirectoryQueryArguments *aArguments,                             nsISupportsArray **aValues){    if (!aCard || !aArguments || !aValues ) {         return NS_ERROR_NULL_POINTER ;     }    *aValues = nsnull ;    CharPtrArrayGuard properties ;    nsCOMPtr<nsISupportsArray> values ;    nsresult retCode = NS_OK ;        retCode = aArguments->GetReturnProperties(properties.GetSizeAddr(), properties.GetArrayAddr()) ;    NS_ENSURE_SUCCESS(retCode, retCode) ;    PRUint32 i = 0 ;    nsAbDirectoryQueryPropertyValue *newValue = nsnull ;	nsCOMPtr<nsIAbDirectoryQueryPropertyValue> propertyValue ;    for (i = 0 ; i < properties.GetSize() ; ++ i) {        const char* cPropName = properties[i] ;        newValue = nsnull ;		if (!nsCRT::strcmp(cPropName, "card:nsIAbCard")) {			nsCOMPtr<nsISupports> bogusInterface (do_QueryInterface(aCard, &retCode)) ;			NS_ENSURE_SUCCESS(retCode, retCode) ;			newValue = new nsAbDirectoryQueryPropertyValue (cPropName, bogusInterface) ;		}		else if (!nsCRT::strcmp(cPropName, "card:URI")) {			nsCOMPtr<nsIRDFResource> rdfResource (do_QueryInterface(aCard, &retCode)) ;			nsXPIDLCString uri;			NS_ENSURE_SUCCESS(retCode, retCode) ;			retCode = rdfResource->GetValue(getter_Copies(uri)) ;			NS_ENSURE_SUCCESS(retCode, retCode) ;			newValue = new nsAbDirectoryQueryPropertyValue(cPropName, NS_ConvertASCIItoUCS2(uri).get()) ;		}        else {			nsXPIDLString value ;			retCode = aCard->GetCardValue(cPropName, getter_Copies(value)) ;			NS_ENSURE_SUCCESS(retCode, retCode) ;            if (!value.IsEmpty()) {                newValue = new nsAbDirectoryQueryPropertyValue(cPropName, value.get()) ;            }		}        if (newValue) {			if (!values) {				NS_NewISupportsArray(getter_AddRefs(values)) ;			}			propertyValue = newValue ;			values->AppendElement (propertyValue) ;        }    }    *aValues = values ;    NS_ADDREF(*aValues) ;    return retCode ;}