Monotone-Parent: a1d5297ee60258830645ba6ddadf4cdd9b01b0fd

Monotone-Revision: 9526db8a187e1a3f30ac4b5933d589fcb9dbbc40

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-08-27T16:09:26
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-08-27 16:09:26 +00:00
parent cfe59955d9
commit d72fc4792b
3 changed files with 28 additions and 22 deletions
+17 -17
View File
@@ -75,33 +75,33 @@
[rendering appendString: [tag uppercaseString]]; [rendering appendString: [tag uppercaseString]];
attributes = [anElement attributes]; attributes = [anElement attributes];
keys = [[attributes allKeys] objectEnumerator]; keys = [[attributes allKeys] objectEnumerator];
key = [keys nextObject]; while ((key = [keys nextObject]))
while (key)
{ {
NSString *s; NSString *s;
int i, c; int i, c;
renderedAttrs = [[attributes objectForKey: key] renderedForCards]; renderedAttrs = [[attributes objectForKey: key] renderedForCards];
[rendering appendFormat: @";%@=", [key uppercaseString]];
c = [renderedAttrs count]; c = [renderedAttrs count];
if (c > 0)
{
[rendering appendFormat: @";%@=", [key uppercaseString]];
for (i = 0; i < c; i++) for (i = 0; i < c; i++)
{ {
s = [renderedAttrs objectAtIndex: i]; s = [renderedAttrs objectAtIndex: i];
// We MUST quote attribute values that have a ":" in them and that /* We MUST quote attribute values that have a ":" in them
// not already quoted and that not already quoted */
if ([s length] > 2 && [s rangeOfString: @":"].length && if ([s length] > 2 && [s rangeOfString: @":"].length &&
[s characterAtIndex: 0] != '"' && ![s hasSuffix: @"\""]) [s characterAtIndex: 0] != '"' && ![s hasSuffix: @"\""])
s = [NSString stringWithFormat: @"\"%@\"", s]; s = [NSString stringWithFormat: @"\"%@\"", s];
[rendering appendFormat: @"%@", s]; [rendering appendFormat: @"%@", s];
if (i+1 < c) if (i+1 < c)
[rendering appendString: @","]; [rendering appendString: @","];
} }
}
key = [keys nextObject];
} }
values = [anElement values]; values = [anElement values];
+9
View File
@@ -1,3 +1,12 @@
2009-08-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* NSArray+NGCards.m (-renderedForCards): empty values are not
returned, so as to avoid rendering attributes that do not have a
value.
* CardVersitRenderer.m (-renderElement:): we avoid outputting
attribute keys if no non-empty value has been returned.
2009-07-17 Cyril Robert <crobert@inverse.ca> 2009-07-17 Cyril Robert <crobert@inverse.ca>
* iCalPerson.m: Lowercased MAILTO to make it work with iCal. * iCalPerson.m: Lowercased MAILTO to make it work with iCal.
+2 -5
View File
@@ -114,12 +114,9 @@
purified = [NSMutableArray arrayWithCapacity: [self count]]; purified = [NSMutableArray arrayWithCapacity: [self count]];
strings = [self objectEnumerator]; strings = [self objectEnumerator];
string = [strings nextObject]; while ((string = [strings nextObject]))
while (string) if ([string length] > 0)
{
[purified addObject: [string escapedForCards]]; [purified addObject: [string escapedForCards]];
string = [strings nextObject];
}
return purified; return purified;
} }