From 28d869ce2271a5c8748ee724352eb76d02b9d86d Mon Sep 17 00:00:00 2001 From: wolfgang Date: Mon, 28 Jan 2008 15:32:48 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1342 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 6 ++++++ SOPE/NGCards/ChangeLog | 6 ++++++ SOPE/NGCards/iCalDailyRecurrenceCalculator.m | 14 +++++++------- UI/Scheduler/UIxComponentEditor.m | 6 ++---- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08e20983..89bf1d66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-28 Wolfgang Sourdeau + + * 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 * SoObjects/SOGo/SOGoUser.m ([SOGoUser diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index fbac587b..b66b3e49 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,9 @@ +2008-01-28 Wolfgang Sourdeau + + * iCalDailyRecurrenceCalculator.m ([iCalDailyRecurrenceCalculator + -recurrenceRangesWithinCalendarDateRange:]): make use of << + instead of exp2 to compute the mask. + 2008-01-22 Wolfgang Sourdeau * iCalRecurrenceRule.m ([iCalRecurrenceRule -repeatInterval]): diff --git a/SOPE/NGCards/iCalDailyRecurrenceCalculator.m b/SOPE/NGCards/iCalDailyRecurrenceCalculator.m index 7c7d2656..6c9fd423 100644 --- a/SOPE/NGCards/iCalDailyRecurrenceCalculator.m +++ b/SOPE/NGCards/iCalDailyRecurrenceCalculator.m @@ -23,18 +23,16 @@ #import #import +#import + +#import "NSCalendarDate+ICal.h" #import "iCalRecurrenceCalculator.h" +#import "iCalRecurrenceRule.h" @interface iCalDailyRecurrenceCalculator : iCalRecurrenceCalculator @end -#import -#import "iCalRecurrenceRule.h" -#import "NSCalendarDate+ICal.h" - -#include - @interface iCalRecurrenceCalculator(PrivateAPI) - (NSCalendarDate *)lastInstanceStartDate; @end @@ -105,7 +103,9 @@ // 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; } diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 789f21f7..1c5ab268 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -1370,11 +1370,9 @@ RANGE(2); 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]; } -- 2.39.5