]> err.no Git - sope/commitdiff
yet another bugfix for recurrence calculation
authorznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 2 Mar 2005 19:51:57 +0000 (19:51 +0000)
committerznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 2 Mar 2005 19:51:57 +0000 (19:51 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@609 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-ical/NGiCal/ChangeLog
sope-ical/NGiCal/NGiCal.xcode/project.pbxproj
sope-ical/NGiCal/Version
sope-ical/NGiCal/iCalRecurrenceCalculator.m

index f2ca380478838ab3c07a7517b6b4b266191c2c38..3816b102fd786a223109854245a1fd559f20fd92 100644 (file)
@@ -1,5 +1,8 @@
 2005-03-02  Marcus Mueller  <znek@mulle-kybernetik.com>
 
+       * iCalRecurrenceCalculator.m: bugfix for monthly and yearly recurrences
+         (v4.5.49)
+
        * iCalRecurrenceCalculator.m: optimized exception date handling in
          complex calculation method quite a bit. Fixed bugs in all calculation
          methods by introducing checks on the desired range. (v4.5.48)
index dda6ae5a4d63e28822659faa668bcd27a0575ee2..2372cd340b0097f33ea91f03068331cf202ca778 100644 (file)
                        );
                        buildSettings = {
                                DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 4.5.48;
+                               DYLIB_CURRENT_VERSION = 4.5.49;
                                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.48;
+                               DYLIB_CURRENT_VERSION = 4.5.49;
                                FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
                                FRAMEWORK_VERSION = A;
                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
index aa4b270737ef5c6e8f31c902248fcb21572dd4ff..4d808abe41ad8209cbe35b7e199447f1e8251528 100644 (file)
@@ -2,7 +2,7 @@
 
 MAJOR_VERSION=4
 MINOR_VERSION=5
-SUBMINOR_VERSION:=48
+SUBMINOR_VERSION:=49
 
 # v4.5.40 requires NGExtensions v4.5.145
 # v4.5.37 requires NGExtensions v4.5.140
index 797037e1ab4290e38964d449ed37699f8b3a67ec..18ef6b3c225db7cb93233de63397060f11493580 100644 (file)
@@ -548,7 +548,8 @@ static Class yearlyCalcClass  = Nil;
 - (NSArray *)recurrenceRangesWithinCalendarDateRange:(NGCalendarDateRange *)_r {
   NSMutableArray *ranges;
   NSCalendarDate *firStart, *rStart, *rEnd, *until;
-  unsigned       i, count, interval, diff;
+  unsigned       i, count, interval;
+  int            diff;
 
   firStart = [self->firstRange startDate];
   rStart   = [_r startDate];
@@ -564,13 +565,16 @@ static Class yearlyCalcClass  = Nil;
   }
 
   diff   = [firStart monthsBetweenDate:rStart];
+  if ((diff != 0) && [rStart compare:firStart] == NSOrderedAscending)
+    diff = -diff;
+
   count  = [rStart monthsBetweenDate:rEnd] + 1;
   ranges = [NSMutableArray arrayWithCapacity:count];
   for (i = 0 ; i < count; i++) {
-    unsigned test;
+    int test;
     
     test = diff + i;
-    if ((test % interval) == 0) {
+    if ((test >= 0) && (test % interval) == 0) {
       NSCalendarDate      *start, *end;
       NGCalendarDateRange *r;
       
@@ -610,7 +614,8 @@ static Class yearlyCalcClass  = Nil;
 - (NSArray *)recurrenceRangesWithinCalendarDateRange:(NGCalendarDateRange *)_r {
   NSMutableArray *ranges;
   NSCalendarDate *firStart, *rStart, *rEnd, *until;
-  unsigned       i, count, interval, diff;
+  unsigned       i, count, interval;
+  int            diff;
   
   firStart = [self->firstRange startDate];
   rStart   = [_r startDate];
@@ -626,13 +631,16 @@ static Class yearlyCalcClass  = Nil;
   }
   
   diff   = [firStart yearsBetweenDate:rStart];
+  if ((diff != 0) && [rStart compare:firStart] == NSOrderedAscending)
+    diff = -diff;
+
   count  = [rStart yearsBetweenDate:rEnd] + 1;
   ranges = [NSMutableArray arrayWithCapacity:count];
   for (i = 0 ; i < count; i++) {
-    unsigned test;
+    int test;
 
     test = diff + i;
-    if ((test % interval) == 0) {
+    if ((test >= 0) && (test % interval) == 0) {
       NSCalendarDate      *start, *end;
       NGCalendarDateRange *r;