From e1f2ba7b7a9340043f1cd39337d8a80a896cec10 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 5 Apr 2011 13:33:48 +0000 Subject: [PATCH] Monotone-Parent: 27abf27ddc019acbc13325c08121a103bf035716 Monotone-Revision: 7cced8aec79bd2e835d318154c57fb61273a4b35 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-04-05T13:33:48 Monotone-Branch: ca.inverse.sogo --- SOPE/NGCards/CardGroup.m | 11 ++++------- SOPE/NGCards/NSString+NGCards.m | 4 +--- SOPE/NGCards/iCalXMLRenderer.m | 4 ---- SOPE/NGCards/iCalYearlyRecurrenceCalculator.m | 13 ++++++------- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/SOPE/NGCards/CardGroup.m b/SOPE/NGCards/CardGroup.m index 138c6b99c..6084ed0ab 100644 --- a/SOPE/NGCards/CardGroup.m +++ b/SOPE/NGCards/CardGroup.m @@ -75,16 +75,13 @@ static NGCardsSaxHandler *sax = nil; if (source) { - cardParser = [self cardParser]; [sax setTopElementClass: [self class]]; - if (parser) - { - [parser parseFromSource: source]; + cardParser = [self cardParser]; + [cardParser parseFromSource: source]; - cardGroups = [sax cards]; - [sax reset]; - } + cardGroups = [sax cards]; + [sax reset]; } return cardGroups; diff --git a/SOPE/NGCards/NSString+NGCards.m b/SOPE/NGCards/NSString+NGCards.m index 9b135c86c..0387b9b6e 100644 --- a/SOPE/NGCards/NSString+NGCards.m +++ b/SOPE/NGCards/NSString+NGCards.m @@ -189,7 +189,7 @@ */ unsigned i, len; NSTimeInterval ti; - BOOL isNegative, isTime; + BOOL isNegative; int val; unichar c; @@ -213,14 +213,12 @@ val = 0; len = [self length]; - isTime = NO; for (i++; i < len; i++) { c = [self characterAtIndex: i]; if (c == 't' || c == 'T') { - isTime = YES; val = 0; } else if (isdigit (c)) diff --git a/SOPE/NGCards/iCalXMLRenderer.m b/SOPE/NGCards/iCalXMLRenderer.m index c51c9ec9a..1911ef76a 100644 --- a/SOPE/NGCards/iCalXMLRenderer.m +++ b/SOPE/NGCards/iCalXMLRenderer.m @@ -135,19 +135,15 @@ - (NSString *) _xmlRenderParameters { NSArray *keys; - NSMutableArray *renderedValues; NSMutableString *rendering; NSString *currentValue; int count, max; - BOOL displayed; keys = [attributes allKeys]; max = [keys count]; if (max > 0) { rendering = [NSMutableString stringWithCapacity: 64]; - renderedValues = [NSMutableArray arrayWithCapacity: max]; - displayed = NO; for (count = 0; count < max; count++) { currentValue diff --git a/SOPE/NGCards/iCalYearlyRecurrenceCalculator.m b/SOPE/NGCards/iCalYearlyRecurrenceCalculator.m index fae6233f5..e47ae3912 100644 --- a/SOPE/NGCards/iCalYearlyRecurrenceCalculator.m +++ b/SOPE/NGCards/iCalYearlyRecurrenceCalculator.m @@ -126,10 +126,6 @@ // The interval must be ignored as well since it refers to the years. [rrule setRepeatCount: 0]; [rrule setInterval: @"1"]; - monthlyCalc = [[iCalMonthlyRecurrenceCalculator alloc] - initWithRecurrenceRule: rrule - firstInstanceCalendarDateRange: firstRange]; - [monthlyCalc autorelease]; // There's a bug in GNUstep in [NSCalendarDate dateByAddingYears:months:days:] // that causes errors when adding subsequently a month. For this reason, @@ -161,15 +157,18 @@ currentMonth = [referenceDate monthOfYear]; for (yearIdxInRange = 0 ; yearIdxInRange < numberOfYearsInRange; yearIdxInRange++) { - int k, test, year; + int k, test; test = diff + yearIdxInRange; if ((test >= 0) && (test % interval) == 0) { - year = yearIdxInRange + [referenceDate yearOfCommonEra]; - if (byMonth) { + monthlyCalc = [[iCalMonthlyRecurrenceCalculator alloc] + initWithRecurrenceRule: rrule + firstInstanceCalendarDateRange: firstRange]; + [monthlyCalc autorelease]; + // When there's a BYMONTH constraint, evaluate each month of the constraint using // the monthly calculator. for (j = 0; currentMonth < 13 && j <= 12; j++, currentMonth++, monthDiff++)