+2008-01-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
+ -takeValuesFromRequest:_rqinContext:_ctx]): make use of the <<
+ operator to handle the day masks in custom rules.
+
2008-01-24 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoUser.m ([SOGoUser
+2008-01-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * iCalDailyRecurrenceCalculator.m ([iCalDailyRecurrenceCalculator
+ -recurrenceRangesWithinCalendarDateRange:]): make use of <<
+ instead of exp2 to compute the mask.
+
2008-01-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* iCalRecurrenceRule.m ([iCalRecurrenceRule -repeatInterval]):
#import <Foundation/NSArray.h>
#import <NGExtensions/NSCalendarDate+misc.h>
+#import <NGExtensions/NGCalendarDateRange.h>
+
+#import "NSCalendarDate+ICal.h"
#import "iCalRecurrenceCalculator.h"
+#import "iCalRecurrenceRule.h"
@interface iCalDailyRecurrenceCalculator : iCalRecurrenceCalculator
@end
-#import <NGExtensions/NGCalendarDateRange.h>
-#import "iCalRecurrenceRule.h"
-#import "NSCalendarDate+ICal.h"
-
-#include <math.h>
-
@interface iCalRecurrenceCalculator(PrivateAPI)
- (NSCalendarDate *)lastInstanceStartDate;
@end
// FIXME: Should we also check the end date? We might want
// to check if the end date is also within it.
if ([self->rrule byDayMask]) {
- mask = [start dayOfWeek] == 0 ? iCalWeekDaySunday : (unsigned int)exp2([start dayOfWeek]-1);
+ mask = ([start dayOfWeek]
+ ? (unsigned int) 1 << ([start dayOfWeek] - 1)
+ : iCalWeekDaySunday);
if (([self->rrule byDayMask]&mask) != mask) continue;
}
v = [[self repeat2] componentsSeparatedByString: @","];
c = [v count];
mask = 0;
-
+
while (c--)
- {
- mask |= (unsigned int)exp2([[v objectAtIndex: c] intValue]-1);
- }
+ mask |= 1 << ([[v objectAtIndex: c] intValue] - 1);
[theRule setByDayMask: mask];
}