From 7a8321aecf28a9ee3fc98ec02c90f705efc7de23 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 14 Jul 2008 15:14:40 +0000 Subject: [PATCH] Monotone-Parent: ce32e1242b761204db803e0d285c6df7dac31cfb Monotone-Revision: c26a4cd6f1b197f62132a741a9db02e3ec7994ee Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-07-14T15:14:40 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 11 ++++++++++ .../Appointments/SOGoAppointmentFolder.m | 22 ++++++++++--------- .../iCalRepeatableEntityObject+SOGo.m | 12 +++++----- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9bd98755b..326438d41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-07-14 Wolfgang Sourdeau + + * SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m + ([iCalRepeatableEntityObject -cycleInfo]): exception dates are now + returned as an array of strings. + + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder + -fixupCyclicRecords:_recordsfetchRange:_r]): fix an infinite loop + occuring when the exception date was not the first date in the list. + 2008-07-11 Wolfgang Sourdeau * SoObjects/Appointments/SOGoAppointmentFolder.m diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 787f1e2ab..0a9e773f6 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -651,6 +651,8 @@ static Class sogoAppointmentFolderKlass = Nil; if ([[currentRecord objectForKey: @"startDate"] isEqual: matchDate]) recordIndex = count; + else + count++; } return recordIndex; @@ -722,8 +724,8 @@ static Class sogoAppointmentFolderKlass = Nil; } - (void) _appendCycleExceptionsFromRow: (NSDictionary *) row - forRange: (NGCalendarDateRange *) dateRange - toArray: (NSMutableArray *) ma + forRange: (NGCalendarDateRange *) dateRange + toArray: (NSMutableArray *) ma { NSArray *elements, *components; unsigned int count, max; @@ -794,7 +796,7 @@ static Class sogoAppointmentFolderKlass = Nil; count = [ranges count]; for (i = 0; i < count; i++) { - rRange = [ranges objectAtIndex:i]; + rRange = [ranges objectAtIndex: i]; fixedRow = [self fixupCycleRecord: row cycleRange: rRange]; if (fixedRow) [_ma addObject:fixedRow]; @@ -1745,13 +1747,13 @@ static Class sogoAppointmentFolderKlass = Nil; { if ([self isValidContentName:_key]) { - url = [[[_ctx request] uri] urlWithoutParameters]; - if ([url hasSuffix: @"AsTask"]) - obj = [SOGoTaskObject objectWithName: _key - inContainer: self]; - else if ([url hasSuffix: @"AsAppointment"]) - obj = [SOGoAppointmentObject objectWithName: _key - inContainer: self]; + url = [[[_ctx request] uri] urlWithoutParameters]; + if ([url hasSuffix: @"AsTask"]) + obj = [SOGoTaskObject objectWithName: _key + inContainer: self]; + else if ([url hasSuffix: @"AsAppointment"]) + obj = [SOGoAppointmentObject objectWithName: _key + inContainer: self]; } } if (!obj) diff --git a/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m b/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m index ce64f0c45..edb0d2dd0 100644 --- a/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m +++ b/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m @@ -35,16 +35,16 @@ NSMutableArray *ma; unsigned int i, count; NSString *valuesString; + iCalRecurrenceRule *rule; ma = nil; + count = [rules count]; if (count > 0) { - ma = [NSMutableArray arrayWithCapacity:count]; + ma = [NSMutableArray arrayWithCapacity: count]; for (i = 0; i < count; i++) { - iCalRecurrenceRule *rule; - rule = [rules objectAtIndex:i]; #warning we could return an NSArray instead and feed it as such to the iCalRecurrenceRule in SOGoAppointmentFolder... valuesString = [[rule values] componentsJoinedByString: @";"]; @@ -73,9 +73,9 @@ rules = [self _indexedRules: [self exceptionRules]]; if (rules) [cycleInfo setObject: rules forKey: @"exRules"]; - - rules = [self _indexedRules: [self exceptionDates]]; - if (rules) + + rules = [self exceptionDates]; + if ([rules count]) [cycleInfo setObject: rules forKey: @"exDates"]; value = [cycleInfo description];