diff options
author | Wang Xin <jedy.wang@sun.com> | 2007-01-08 14:04:45 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-01-08 14:04:45 +0800 |
commit | 748ead1aa51137e30c0e0bd18d888a6b53e1c217 (patch) | |
tree | 4a420550bed67a58ddc00b8636582fa5379a9730 /calendar/gui/e-cal-model.c | |
parent | e5d4654dd7a06013042b29ef86653c1544c6b73b (diff) | |
download | gsoc2013-evolution-748ead1aa51137e30c0e0bd18d888a6b53e1c217.tar.gz gsoc2013-evolution-748ead1aa51137e30c0e0bd18d888a6b53e1c217.tar.zst gsoc2013-evolution-748ead1aa51137e30c0e0bd18d888a6b53e1c217.zip |
Fixes #389961 Check if the item is a event before processing the end time.
2007-01-08 Wang Xin <jedy.wang@sun.com>
Fixes #389961
* gui/e-cal-model.c:(e_cal_model_set_instance_times):
Check if the item is a event before
processing the end time.
svn path=/trunk/; revision=33115
Diffstat (limited to 'calendar/gui/e-cal-model.c')
-rw-r--r-- | calendar/gui/e-cal-model.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 6b47fb96e1..1963ee69c8 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -2101,26 +2101,30 @@ void e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezone *zone) { struct icaltimetype start_time, end_time; + icalcomponent_kind kind; + kind = icalcomponent_isa (comp_data->icalcomp); start_time = icalcomponent_get_dtstart (comp_data->icalcomp); end_time = icalcomponent_get_dtend (comp_data->icalcomp); - if (icaltime_is_null_time (end_time)) { - /* If end_time is null and it's an all day event, - * just make start_time = end_time so that end_time - * will be a valid date - */ - end_time = start_time; - icaltime_adjust (&end_time, 1, 0, 0, 0); - icalcomponent_set_dtend (comp_data->icalcomp, end_time); - } else if (start_time.is_date && end_time.is_date && - (icaltime_compare_date_only (start_time, end_time) == 0)) { - /* If both DTSTART and DTEND are DATE values, and they are the - same day, we add 1 day to DTEND. This means that most - events created with the old Evolution behavior will still - work OK. */ - icaltime_adjust (&end_time, 1, 0, 0, 0); - icalcomponent_set_dtend (comp_data->icalcomp, end_time); + if (kind == ICAL_VEVENT_COMPONENT) { + if (start_time.is_date && icaltime_is_null_time (end_time)) { + /* If end_time is null and it's an all day event, + * just make start_time = end_time so that end_time + * will be a valid date + */ + end_time = start_time; + icaltime_adjust (&end_time, 1, 0, 0, 0); + icalcomponent_set_dtend (comp_data->icalcomp, end_time); + } else if (start_time.is_date && end_time.is_date && + (icaltime_compare_date_only (start_time, end_time) == 0)) { + /* If both DTSTART and DTEND are DATE values, and they are the + same day, we add 1 day to DTEND. This means that most + events created with the old Evolution behavior will still + work OK. */ + icaltime_adjust (&end_time, 1, 0, 0, 0); + icalcomponent_set_dtend (comp_data->icalcomp, end_time); + } } if (start_time.zone) |