Monotone-Parent: 9475f39d99549bfa74e7f88be7e54d9650beb0d5

Monotone-Revision: d953e1b8cae8bcdf2a3cff4219ea365af8391941

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-07-13T20:31:41
This commit is contained in:
Wolfgang Sourdeau committed 2012-07-13 20:31:41 +00:00
1 parent caf58a7c4a
commit 82f3f1b3d9
8 files changed
+152 -42

No files matched your search

+4 -38
View File
@@ -269,45 +269,11 @@
return iCalString;
}
static inline BOOL _occurenceHasID (iCalRepeatableEntityObject *occurence,
NSString *recID)
- (iCalRepeatableEntityObject *) lookupOccurrence: (NSString *) recID
{
unsigned int seconds, recSeconds;
seconds = [recID intValue];
recSeconds = [[occurence recurrenceId] timeIntervalSince1970];
[self subclassResponsibility: _cmd];
return (seconds == recSeconds);
}
- (iCalRepeatableEntityObject *) lookupOccurence: (NSString *) recID
{
iCalRepeatableEntityObject *component, *occurence, *currentOccurence;
NSArray *occurences;
unsigned int count, max;
occurence = nil;
component = [self component: NO secure: NO];
if ([component hasRecurrenceRules])
{
occurences = [[self calendar: NO secure: NO] allObjects];
max = [occurences count];
count = 1; // skip master event
while (!occurence && count < max)
{
currentOccurence = [occurences objectAtIndex: count];
if (_occurenceHasID (currentOccurence, recID))
occurence = currentOccurence;
else
count++;
}
}
else if (_occurenceHasID (component, recID))
/* The "master" event could be that occurrence. */
occurence = component;
return occurence;
return nil;
}
- (SOGoComponentOccurence *) occurence: (iCalRepeatableEntityObject *) component
@@ -397,7 +363,7 @@ static inline BOOL _occurenceHasID (iCalRepeatableEntityObject *occurence,
else if ([lookupName hasPrefix: @"occurence"])
{
recID = [lookupName substringFromIndex: 9];
occurence = [self lookupOccurence: recID];
occurence = [self lookupOccurrence: recID];
if (occurence)
isNewOccurence = NO;
else