]> err.no Git - sope/commitdiff
improved byday (failure) handling
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 19 Sep 2005 23:01:20 +0000 (23:01 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 19 Sep 2005 23:01:20 +0000 (23:01 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1120 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-ical/NGiCal/ChangeLog
sope-ical/NGiCal/Version
sope-ical/NGiCal/iCalMonthlyRecurrenceCalculator.m
sope-ical/NGiCal/iCalRecurrenceCalculator.m

index 27203741b95cca31c354f61effe23ab97b37fd3f..84247db3668d47502ed0f02e3d8e4ba7d1bda095 100644 (file)
@@ -1,5 +1,8 @@
 2005-09-20  Helge Hess  <helge.hess@opengroupware.org>
 
+       * iCalMonthlyRecurrenceCalculator.m: stop calculation if a byday part
+         was detected in the rule (v4.5.64)
+
        * iCalRecurrenceCalculator.m: moved cluster subclasses to own source
          files (v4.5.63)
 
index bae8b2810feec535b16dc09cfc4b3e5fd68b2b73..0e2ffe99bf81001ef96bbeb99e543109fe718a9f 100644 (file)
@@ -2,7 +2,7 @@
 
 MAJOR_VERSION=4
 MINOR_VERSION=5
-SUBMINOR_VERSION:=63
+SUBMINOR_VERSION:=64
 
 # v4.5.40 requires NGExtensions v4.5.145
 # v4.5.37 requires NGExtensions v4.5.140
index 1eacf1daea18dbf18fa01e9010d3b6103a6d3f1f..be6e6f8af56e3b2506db7800ce184a6d2102dbb5 100644 (file)
   rEnd     = [_r endDate];
   interval = [self->rrule repeatInterval];
   until    = [self lastInstanceStartDate];
-
-  if (until) {
+  
+  if ([self->rrule byDayMask] != 0) {
+    [self errorWithFormat:@"cannot process byday part of rrule: %@", 
+           self->rrule];
+    return nil;
+  }
+  
+  if (until != nil) {
     if ([until compare:rStart] == NSOrderedAscending)
       return nil;
     if ([until compare:rEnd] == NSOrderedDescending)
index 9d2febd729be97dc54fb69c474ddc40add207943..6e048f7eff5387fef2cd0bdf2cf9898549da1a3d 100644 (file)
@@ -269,9 +269,9 @@ static Class yearlyCalcClass  = Nil;
 - (NGCalendarDateRange *)lastInstanceCalendarDateRange {
   NSCalendarDate *start, *end;
 
-  start = [self lastInstanceStartDate];
-  if (!start)
+  if ((start = [self lastInstanceStartDate]) == nil)
     return nil;
+  
   end   = [start addTimeInterval:[self->firstRange duration]];
   return [NGCalendarDateRange calendarDateRangeWithStartDate:start
                               endDate:end];
@@ -280,12 +280,14 @@ static Class yearlyCalcClass  = Nil;
 - (NSCalendarDate *)lastInstanceStartDate {
   NSCalendarDate *until;
   
-  /* NOTE: this is horribly inaccurate and doesn't even consider the use
-  of repeatCount. It MUST be implemented by subclasses properly! However,
-  it does the trick for SOGO 1.0 - that's why it's left here.
+  /* 
+     NOTE: this is horribly inaccurate and doesn't even consider the use
+           of repeatCount. It MUST be implemented by subclasses properly!
+          However, it does the trick for SOGo 1.0 - that's why it's left here.
   */
   if ((until = [self->rrule untilDate]) != nil)
     return until;
+  
   return nil;
 }