diff --git a/SOPE/NGCards/iCalRecurrenceRule.m b/SOPE/NGCards/iCalRecurrenceRule.m index 6ec05fadc..158c2fff2 100644 --- a/SOPE/NGCards/iCalRecurrenceRule.m +++ b/SOPE/NGCards/iCalRecurrenceRule.m @@ -1,6 +1,6 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG - Copyright (C) 2006-2010 Inverse inc. + Copyright (C) 2006-2016 Inverse inc. This file is part of SOPE. @@ -291,6 +291,8 @@ NSString *iCalWeekDayString[] = { @"SU", @"MO", @"TU", @"WE", @"TH", @"FR", NSString *frequency; iCalRecurrenceFrequency freq; + freq = 0; + if ([value length] > 0) { frequency = [value uppercaseString]; @@ -308,11 +310,7 @@ NSString *iCalWeekDayString[] = { @"SU", @"MO", @"TU", @"WE", @"TH", @"FR", freq = iCalRecurrenceFrequenceMinutely; else if ([frequency isEqualToString:@"SECONDLY"]) freq = iCalRecurrenceFrequenceSecondly; - else - freq = (iCalRecurrenceFrequency) NSNotFound; } - else - freq = (iCalRecurrenceFrequency) NSNotFound; return freq; } diff --git a/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m b/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m index 88363186f..bd9d1d9b9 100644 --- a/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m +++ b/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m @@ -1,6 +1,6 @@ /* iCalRepeatableEntityObject+SOGo.m - this file is part of SOGo * - * Copyright (C) 2007-2015 Inverse inc. + * Copyright (C) 2007-2016 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -164,12 +164,12 @@ rule = [iCalRecurrenceRule new]; [rule setInterval: @"1"]; - frequency = (int) NSNotFound; + frequency = 0; o = [repeat objectForKey: @"frequency"]; if ([o isKindOfClass: [NSString class]]) { frequency = [rule valueForFrequency: o]; - if ((int) frequency == NSNotFound) + if (!frequency) { if ([o caseInsensitiveCompare: @"BI-WEEKLY"] == NSOrderedSame) { @@ -223,7 +223,7 @@ [rule setValues: o atIndex: 0 forKey: @"bymonth"]; } - if ((int) frequency != NSNotFound) + if (frequency) { [rule setFrequency: frequency]; [self setRecurrenceRules: [NSArray arrayWithObject: rule]];