From 33f48d299ea754aa6679a092ad820e8c96a020f6 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 24 Apr 2000 20:01:44 +0000 Subject: allow for null CN (parse_person): allow for null sent_by * pcs/icalendar.c (parse_person): allow for null CN (parse_person): allow for null sent_by * pcs/Makefile.am: build icalendar-test * pcs/icalendar-test.c: a test which loads an ical file and converts it to our internal format, and then saves it back out. svn path=/trunk/; revision=2588 --- calendar/pcs/icalendar-save.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'calendar/pcs/icalendar-save.c') diff --git a/calendar/pcs/icalendar-save.c b/calendar/pcs/icalendar-save.c index a3b2505778..1b35d2dadf 100644 --- a/calendar/pcs/icalendar-save.c +++ b/calendar/pcs/icalendar-save.c @@ -164,9 +164,9 @@ icalcomponent_create_from_ical_object (iCalObject *ical) /*** transp ***/ { if (ical->transp == ICAL_TRANSP_PROPERTY) - icalproperty_set_transp (prop, "TRANSPARENT"); + prop = icalproperty_new_transp ("TRANSPARENT"); else - icalproperty_set_transp (prop, "OPAQUE"); + prop = icalproperty_new_transp ("OPAQUE"); icalcomponent_add_property (comp, prop); } @@ -347,8 +347,10 @@ void unparse_person (iCalPerson *person, icalproperty *person_prop) /* convert iCalPerson to an icalproperty */ - param = icalparameter_new_cn (person->name); - icalproperty_add_parameter (person_prop, param); + if (person->name) { + param = icalparameter_new_cn (person->name); + icalproperty_add_parameter (person_prop, param); + } if (g_strcasecmp (person->role, "CHAIR") == 0) param = icalparameter_new_role (ICAL_ROLE_CHAIR); @@ -418,7 +420,10 @@ void unparse_person (iCalPerson *person, icalproperty *person_prop) icalproperty_add_parameter (person_prop, param); } - param = icalparameter_new_sentby (person->sent_by); + if (person->sent_by) { + param = icalparameter_new_sentby (person->sent_by); + icalproperty_add_parameter (person_prop, param); + } /* ret->deleg_to is a list of ICAL_DIR_PARAMETER */ /* FIX ME ... */ -- cgit v1.2.3