Monotone-Parent: 27abf27ddc019acbc13325c08121a103bf035716
Monotone-Revision: 7cced8aec79bd2e835d318154c57fb61273a4b35 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-04-05T13:33:48 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
0e4a4f522d
commit
e1f2ba7b7a
|
@ -75,16 +75,13 @@ static NGCardsSaxHandler *sax = nil;
|
||||||
|
|
||||||
if (source)
|
if (source)
|
||||||
{
|
{
|
||||||
cardParser = [self cardParser];
|
|
||||||
[sax setTopElementClass: [self class]];
|
[sax setTopElementClass: [self class]];
|
||||||
|
|
||||||
if (parser)
|
cardParser = [self cardParser];
|
||||||
{
|
[cardParser parseFromSource: source];
|
||||||
[parser parseFromSource: source];
|
|
||||||
|
|
||||||
cardGroups = [sax cards];
|
cardGroups = [sax cards];
|
||||||
[sax reset];
|
[sax reset];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cardGroups;
|
return cardGroups;
|
||||||
|
|
|
@ -189,7 +189,7 @@
|
||||||
*/
|
*/
|
||||||
unsigned i, len;
|
unsigned i, len;
|
||||||
NSTimeInterval ti;
|
NSTimeInterval ti;
|
||||||
BOOL isNegative, isTime;
|
BOOL isNegative;
|
||||||
int val;
|
int val;
|
||||||
unichar c;
|
unichar c;
|
||||||
|
|
||||||
|
@ -213,14 +213,12 @@
|
||||||
val = 0;
|
val = 0;
|
||||||
|
|
||||||
len = [self length];
|
len = [self length];
|
||||||
isTime = NO;
|
|
||||||
|
|
||||||
for (i++; i < len; i++)
|
for (i++; i < len; i++)
|
||||||
{
|
{
|
||||||
c = [self characterAtIndex: i];
|
c = [self characterAtIndex: i];
|
||||||
if (c == 't' || c == 'T')
|
if (c == 't' || c == 'T')
|
||||||
{
|
{
|
||||||
isTime = YES;
|
|
||||||
val = 0;
|
val = 0;
|
||||||
}
|
}
|
||||||
else if (isdigit (c))
|
else if (isdigit (c))
|
||||||
|
|
|
@ -135,19 +135,15 @@
|
||||||
- (NSString *) _xmlRenderParameters
|
- (NSString *) _xmlRenderParameters
|
||||||
{
|
{
|
||||||
NSArray *keys;
|
NSArray *keys;
|
||||||
NSMutableArray *renderedValues;
|
|
||||||
NSMutableString *rendering;
|
NSMutableString *rendering;
|
||||||
NSString *currentValue;
|
NSString *currentValue;
|
||||||
int count, max;
|
int count, max;
|
||||||
BOOL displayed;
|
|
||||||
|
|
||||||
keys = [attributes allKeys];
|
keys = [attributes allKeys];
|
||||||
max = [keys count];
|
max = [keys count];
|
||||||
if (max > 0)
|
if (max > 0)
|
||||||
{
|
{
|
||||||
rendering = [NSMutableString stringWithCapacity: 64];
|
rendering = [NSMutableString stringWithCapacity: 64];
|
||||||
renderedValues = [NSMutableArray arrayWithCapacity: max];
|
|
||||||
displayed = NO;
|
|
||||||
for (count = 0; count < max; count++)
|
for (count = 0; count < max; count++)
|
||||||
{
|
{
|
||||||
currentValue
|
currentValue
|
||||||
|
|
|
@ -126,10 +126,6 @@
|
||||||
// The interval must be ignored as well since it refers to the years.
|
// The interval must be ignored as well since it refers to the years.
|
||||||
[rrule setRepeatCount: 0];
|
[rrule setRepeatCount: 0];
|
||||||
[rrule setInterval: @"1"];
|
[rrule setInterval: @"1"];
|
||||||
monthlyCalc = [[iCalMonthlyRecurrenceCalculator alloc]
|
|
||||||
initWithRecurrenceRule: rrule
|
|
||||||
firstInstanceCalendarDateRange: firstRange];
|
|
||||||
[monthlyCalc autorelease];
|
|
||||||
|
|
||||||
// There's a bug in GNUstep in [NSCalendarDate dateByAddingYears:months:days:]
|
// There's a bug in GNUstep in [NSCalendarDate dateByAddingYears:months:days:]
|
||||||
// that causes errors when adding subsequently a month. For this reason,
|
// that causes errors when adding subsequently a month. For this reason,
|
||||||
|
@ -161,15 +157,18 @@
|
||||||
currentMonth = [referenceDate monthOfYear];
|
currentMonth = [referenceDate monthOfYear];
|
||||||
for (yearIdxInRange = 0 ; yearIdxInRange < numberOfYearsInRange; yearIdxInRange++)
|
for (yearIdxInRange = 0 ; yearIdxInRange < numberOfYearsInRange; yearIdxInRange++)
|
||||||
{
|
{
|
||||||
int k, test, year;
|
int k, test;
|
||||||
|
|
||||||
test = diff + yearIdxInRange;
|
test = diff + yearIdxInRange;
|
||||||
if ((test >= 0) && (test % interval) == 0)
|
if ((test >= 0) && (test % interval) == 0)
|
||||||
{
|
{
|
||||||
year = yearIdxInRange + [referenceDate yearOfCommonEra];
|
|
||||||
|
|
||||||
if (byMonth)
|
if (byMonth)
|
||||||
{
|
{
|
||||||
|
monthlyCalc = [[iCalMonthlyRecurrenceCalculator alloc]
|
||||||
|
initWithRecurrenceRule: rrule
|
||||||
|
firstInstanceCalendarDateRange: firstRange];
|
||||||
|
[monthlyCalc autorelease];
|
||||||
|
|
||||||
// When there's a BYMONTH constraint, evaluate each month of the constraint using
|
// When there's a BYMONTH constraint, evaluate each month of the constraint using
|
||||||
// the monthly calculator.
|
// the monthly calculator.
|
||||||
for (j = 0; currentMonth < 13 && j <= 12; j++, currentMonth++, monthDiff++)
|
for (j = 0; currentMonth < 13 && j <= 12; j++, currentMonth++, monthDiff++)
|
||||||
|
|
Loading…
Reference in New Issue