Monotone-Parent: a1d5297ee60258830645ba6ddadf4cdd9b01b0fd

Monotone-Revision: 9526db8a187e1a3f30ac4b5933d589fcb9dbbc40

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-08-27T16:09:26
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2009-08-27 16:09:26 +00:00
parent cfe59955d9
commit d72fc4792b
3 changed files with 28 additions and 22 deletions

View File

@ -75,33 +75,33 @@
[rendering appendString: [tag uppercaseString]];
attributes = [anElement attributes];
keys = [[attributes allKeys] objectEnumerator];
key = [keys nextObject];
while (key)
while ((key = [keys nextObject]))
{
NSString *s;
int i, c;
renderedAttrs = [[attributes objectForKey: key] renderedForCards];
[rendering appendFormat: @";%@=", [key uppercaseString]];
c = [renderedAttrs count];
if (c > 0)
{
[rendering appendFormat: @";%@=", [key uppercaseString]];
for (i = 0; i < c; i++)
{
s = [renderedAttrs objectAtIndex: i];
for (i = 0; i < c; i++)
{
s = [renderedAttrs objectAtIndex: i];
// We MUST quote attribute values that have a ":" in them and that
// not already quoted
if ([s length] > 2 && [s rangeOfString: @":"].length &&
[s characterAtIndex: 0] != '"' && ![s hasSuffix: @"\""])
s = [NSString stringWithFormat: @"\"%@\"", s];
/* We MUST quote attribute values that have a ":" in them
and that not already quoted */
if ([s length] > 2 && [s rangeOfString: @":"].length &&
[s characterAtIndex: 0] != '"' && ![s hasSuffix: @"\""])
s = [NSString stringWithFormat: @"\"%@\"", s];
[rendering appendFormat: @"%@", s];
[rendering appendFormat: @"%@", s];
if (i+1 < c)
[rendering appendString: @","];
}
key = [keys nextObject];
if (i+1 < c)
[rendering appendString: @","];
}
}
}
values = [anElement values];

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>
* iCalPerson.m: Lowercased MAILTO to make it work with iCal.

View File

@ -114,12 +114,9 @@
purified = [NSMutableArray arrayWithCapacity: [self count]];
strings = [self objectEnumerator];
string = [strings nextObject];
while (string)
{
while ((string = [strings nextObject]))
if ([string length] > 0)
[purified addObject: [string escapedForCards]];
string = [strings nextObject];
}
return purified;
}