Monotone-Parent: 28ce727aaf05b14f23fbcec914f8b827755f3483
Monotone-Revision: ec02ae62fee05e50774a4da52cc17e4811526340 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-12-30T19:45:58 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
540237248c
commit
843be30a45
|
@ -46,12 +46,15 @@
|
||||||
- (CardElement *) uniqueChildWithTag: (NSString *) aTag;
|
- (CardElement *) uniqueChildWithTag: (NSString *) aTag;
|
||||||
- (void) setUniqueChild: (CardElement *) aChild;
|
- (void) setUniqueChild: (CardElement *) aChild;
|
||||||
|
|
||||||
|
- (NSMutableArray *) children;
|
||||||
|
|
||||||
- (void) addChild: (CardElement *) aChild;
|
- (void) addChild: (CardElement *) aChild;
|
||||||
- (void) addChildren: (NSArray *) someChildren;
|
- (void) addChildren: (NSArray *) someChildren;
|
||||||
- (void) removeChild: (CardElement *) aChild;
|
- (void) removeChild: (CardElement *) aChild;
|
||||||
- (void) removeChildren: (NSArray *) someChildren;
|
- (void) removeChildren: (NSArray *) someChildren;
|
||||||
|
|
||||||
- (NSMutableArray *) children;
|
- (void) cleanupEmptyChildren;
|
||||||
|
|
||||||
- (CardElement *) firstChildWithTag: (NSString *) aTag;
|
- (CardElement *) firstChildWithTag: (NSString *) aTag;
|
||||||
- (NSArray *) childrenWithTag: (NSString *) aTag;
|
- (NSArray *) childrenWithTag: (NSString *) aTag;
|
||||||
- (NSArray *) childrenWithAttribute: (NSString *) anAttribute
|
- (NSArray *) childrenWithAttribute: (NSString *) anAttribute
|
||||||
|
|
|
@ -142,6 +142,19 @@ static NGCardsSaxHandler *sax = nil;
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL) isVoid
|
||||||
|
{
|
||||||
|
BOOL isVoid = YES;
|
||||||
|
NSUInteger count, max;
|
||||||
|
|
||||||
|
max = [children count];
|
||||||
|
for (count = 0; isVoid && count < max; count++)
|
||||||
|
if (![[children objectAtIndex: count] isVoid])
|
||||||
|
isVoid = NO;
|
||||||
|
|
||||||
|
return isVoid;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) addChild: (CardElement *) aChild
|
- (void) addChild: (CardElement *) aChild
|
||||||
{
|
{
|
||||||
Class mappedClass;
|
Class mappedClass;
|
||||||
|
@ -366,6 +379,23 @@ static NGCardsSaxHandler *sax = nil;
|
||||||
[self addChild: newChild];
|
[self addChild: newChild];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) cleanupEmptyChildren
|
||||||
|
{
|
||||||
|
NSUInteger max;
|
||||||
|
NSInteger count;
|
||||||
|
CardElement *child;
|
||||||
|
|
||||||
|
max = [children count];
|
||||||
|
for (count = max - 1; count > -1; count--)
|
||||||
|
{
|
||||||
|
child = [children objectAtIndex: count];
|
||||||
|
if ([child isKindOfClass: [CardGroup class]])
|
||||||
|
[(CardGroup *) child cleanupEmptyChildren];
|
||||||
|
if ([child isVoid])
|
||||||
|
[children removeObjectAtIndex: count];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *) description
|
- (NSString *) description
|
||||||
{
|
{
|
||||||
NSMutableString *str;
|
NSMutableString *str;
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2011-12-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* CardGroup.m (-isVoid): overriden method.
|
||||||
|
(-cleanupEmptyChildren): make use of "isVoid" to detect and remove
|
||||||
|
empty children.
|
||||||
|
|
||||||
2011-11-21 Francis Lachapelle <flachapelle@inverse.ca>
|
2011-11-21 Francis Lachapelle <flachapelle@inverse.ca>
|
||||||
|
|
||||||
* iCalTimeZone.m (+knownTimeZoneNames): ignore files that don't
|
* iCalTimeZone.m (+knownTimeZoneNames): ignore files that don't
|
||||||
|
|
Loading…
Reference in New Issue