From daba82aa37e66a00076aba62f96a26bcf2047aba Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 26 Oct 2009 18:08:31 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 87f8dab4d95e1de1c7c969e371770ac2d74b83b1 Monotone-Revision: c7ad331417d6c2767578747a293dae8820497511 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-10-26T18:08:31 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 ++ UI/Scheduler/UIxComponentEditor.m | 31 ++++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f0d9100c..c33e549c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ * Updated the Mobile Device Configuration Guide in order to document the iPhone OS 3.x configuration settings (iPhone / iPod) + * UI/Scheduler/UIxComponentEditor.m (_handleCustomRRule:) + Improved the robustness of the code. 2009-10-24 Ludovic Marcotte diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 21e632f1c..8970c29b9 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -1639,22 +1639,23 @@ RANGE(2); // case 0: { - if ([[self repeat2] intValue] > 0) + [theRule setFrequency: iCalRecurrenceFrequenceDaily]; + + if ([[self repeat1] intValue] > 0) { - [theRule setFrequency: iCalRecurrenceFrequenceDaily]; - - if ([[self repeat1] intValue] == 0) - { - [theRule setInterval: [self repeat2]]; - } - else - { - [theRule setByDayMask: (iCalWeekDayMonday - |iCalWeekDayTuesday - |iCalWeekDayWednesday - |iCalWeekDayThursday - |iCalWeekDayFriday)]; - } + [theRule setByDayMask: (iCalWeekDayMonday + |iCalWeekDayTuesday + |iCalWeekDayWednesday + |iCalWeekDayThursday + |iCalWeekDayFriday)]; + } + else + { + // Make sure we haven't received any junk.... + if ([[self repeat2] intValue] < 1) + [self setRepeat2: @"1"]; + + [theRule setInterval: [self repeat2]]; } } break;