icalproperty *icalprop = icalcomponent_get_first_property(mComponent, (icalproperty_kind)kind);
icalproperty_kind propkind = icalproperty_string_to_kind(PromiseFlatCString(kind).get());  if (propkind == ICAL_NO_PROPERTY) return NS_ERROR_INVALID_ARG;  icalproperty *icalprop = nsnull; if (propkind == ICAL_X_PROPERTY) { for (icalprop = icalcomponent_get_first_property(mComponent, ICAL_X_PROPERTY); icalprop; icalprop = icalcomponent_get_next_property(mComponent, ICAL_X_PROPERTY)) {  if (kind.Equals(icalproperty_get_x_name(icalprop))) break; } } else { icalprop = icalcomponent_get_first_property(mComponent, propkind); }
calIcalComponent::GetFirstProperty(PRInt32 kind, calIIcalProperty **prop){    icalproperty *icalprop =        icalcomponent_get_first_property(mComponent, (icalproperty_kind)kind);    if (!icalprop) {        *prop = nsnull;        return NS_OK;    }    *prop = new calIcalProperty(icalprop, this);    if (!*prop)        return NS_ERROR_OUT_OF_MEMORY;    NS_ADDREF(*prop);    return NS_OK;}