);
buildSettings = {
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 4.5.47;
+ DYLIB_CURRENT_VERSION = 4.5.48;
FRAMEWORK_SEARCH_PATHS = "\"$(USER_LIBRARY_DIR)/EmbeddedFrameworks\"";
FRAMEWORK_VERSION = A;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
);
buildSettings = {
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 4.5.47;
+ DYLIB_CURRENT_VERSION = 4.5.48;
FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
FRAMEWORK_VERSION = A;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
id rule;
iCalRecurrenceCalculator *calc;
NSMutableArray *ranges;
+ NSMutableArray *exDates;
unsigned i, count, rCount;
ranges = [NSMutableArray array];
if (![ranges count])
return nil;
- /* exception dates are also possible */
- rCount = [ranges count];
+ /* exception dates */
+
count = [_exDates count];
+ if (!count) return ranges;
+
+ /* sort out exDates not within range */
+
+ exDates = [NSMutableArray arrayWithCapacity:count];
for (i = 0; i < count; i++) {
- id exDate;
- NGCalendarDateRange *r;
- unsigned k;
+ id exDate;
exDate = [_exDates objectAtIndex:i];
if (![exDate isKindOfClass:NSCalendarDateClass]) {
exDate = [NSCalendarDate calendarDateWithICalRepresentation:exDate];
}
+ if ([_r containsDate:exDate])
+ [exDates addObject:exDate];
+ }
+
+ /* remove matching exDates from ranges */
+
+ count = [exDates count];
+ if (!count) return ranges;
+
+ rCount = [ranges count];
+ for (i = 0; i < count; i++) {
+ NSCalendarDate *exDate;
+ NGCalendarDateRange *r;
+ unsigned k;
+
+ exDate = [exDates objectAtIndex:i];
for (k = 0; k < rCount; k++) {
- r = [ranges objectAtIndex:(rCount - k) - 1];
+ unsigned rIdx;
+
+ rIdx = (rCount - k) - 1;
+ r = [ranges objectAtIndex:rIdx];
if ([r containsDate:exDate]) {
- [ranges removeObjectAtIndex:k];
+ [ranges removeObjectAtIndex:rIdx];
+ rCount--;
+ break; /* this is safe because we know that ranges don't overlap */
}
}
}
end = [start addTimeInterval:[self->firstRange duration]];
r = [NGCalendarDateRange calendarDateRangeWithStartDate:start
endDate:end];
- [ranges addObject:r];
+ if ([_r containsDateRange:r])
+ [ranges addObject:r];
}
}
}
end = [start addTimeInterval:[self->firstRange duration]];
r = [NGCalendarDateRange calendarDateRangeWithStartDate:start
endDate:end];
- [ranges addObject:r];
+ if ([_r containsDateRange:r])
+ [ranges addObject:r];
}
}
}
end = [start addTimeInterval:[self->firstRange duration]];
r = [NGCalendarDateRange calendarDateRangeWithStartDate:start
endDate:end];
- [ranges addObject:r];
+ if ([_r containsDateRange:r])
+ [ranges addObject:r];
}
}
}
end = [start addTimeInterval:[self->firstRange duration]];
r = [NGCalendarDateRange calendarDateRangeWithStartDate:start
endDate:end];
- [ranges addObject:r];
+ if ([_r containsDateRange:r])
+ [ranges addObject:r];
}
}
return ranges;
end = [start addTimeInterval:[self->firstRange duration]];
r = [NGCalendarDateRange calendarDateRangeWithStartDate:start
endDate:end];
- [ranges addObject:r];
+ if ([_r containsDateRange:r])
+ [ranges addObject:r];
}
}
return ranges;