diff options
Diffstat (limited to 'calendar/cal-util/cal-recur.c')
-rw-r--r-- | calendar/cal-util/cal-recur.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/calendar/cal-util/cal-recur.c b/calendar/cal-util/cal-recur.c index 28b1be9aec..1f11e89c0f 100644 --- a/calendar/cal-util/cal-recur.c +++ b/calendar/cal-util/cal-recur.c @@ -677,7 +677,9 @@ cal_recur_generate_instances_of_rule (CalComponent *comp, g_return_if_fail (start >= -1); g_return_if_fail (end >= -1); - /* Get dtstart, dtend, recurrences, and exceptions */ + /* Get dtstart, dtend, recurrences, and exceptions. Note that + cal_component_get_dtend() will convert a DURATION property to a + DTEND so we don't need to worry about that. */ cal_component_get_dtstart (comp, &dtstart); cal_component_get_dtend (comp, &dtend); @@ -706,8 +708,6 @@ cal_recur_generate_instances_of_rule (CalComponent *comp, if (start == -1) start = dtstart_time; - /* FIXME: DURATION could be used instead, couldn't it? - Damon */ - /* If there is no DTEND, then use the same as the DTSTART. For DATE-TIME values that means we will just have a single point in time. For DATE values it means we end up with the entire day. */ @@ -2049,6 +2049,10 @@ cal_obj_bysetpos_filter (CalRecurrence *recur, /* Negative values count back from the end of the array. */ if (pos < 0) pos += len; + /* Positive values need to be decremented since the array is + 0-based. */ + else + pos--; if (pos >= 0 && pos < len) { occ = &g_array_index (occs, CalObjTime, pos); |