From 2e38d8111b03845e8f642a337457e90c2b4b59d2 Mon Sep 17 00:00:00 2001 From: "mattwillis%gmail.com" Date: Sun, 14 Jan 2007 03:47:04 +0000 Subject: [PATCH] bug 327602 - Move VTIMEZONEs to the beginning of a VCALENDAR to make CGPro happier. r1=ctalbert, r2=mvl --- calendar/libical/src/libical/icalcomponent.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/calendar/libical/src/libical/icalcomponent.c b/calendar/libical/src/libical/icalcomponent.c index 97c1cc2930e..eaa1f409ee2 100644 --- a/calendar/libical/src/libical/icalcomponent.c +++ b/calendar/libical/src/libical/icalcomponent.c @@ -587,10 +587,14 @@ icalcomponent_add_component (icalcomponent* parent, icalcomponent* child) child->parent = parent; - pvl_push(parent->components,child); + /* Fix for Mozilla - bug 327602 */ + if (child->kind != ICAL_VTIMEZONE_COMPONENT) { + pvl_push(parent->components, child); + } else { + /* VTIMEZONES should be first in the resulting VCALENDAR. */ + pvl_unshift(parent->components, child); - /* If the new component is a VTIMEZONE, add it to our array. */ - if (child->kind == ICAL_VTIMEZONE_COMPONENT) { + /* Add the VTIMEZONE to our array. */ /* FIXME: Currently we are also creating this array when loading in a builtin VTIMEZONE, when we don't need it. */ if (!parent->timezones)