mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-20 15:44:53 +00:00
propagate from branch 'ca.inverse.sogo.1_3_15' (head e93a01f806a40f4a4ff41e64bf05eae122e0eb6a)
to branch 'ca.inverse.sogo' (head 53c201da944fae4865d8c023837ade73f6a37bef) Monotone-Parent: 53c201da944fae4865d8c023837ade73f6a37bef Monotone-Parent: e93a01f806a40f4a4ff41e64bf05eae122e0eb6a Monotone-Revision: f92e3e155f030585d765d28f5eee4696fae2d5c0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-19T02:50:02 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -106,6 +106,9 @@
|
||||
|
||||
- (void) addType: (NSString *) aType;
|
||||
|
||||
- (NSArray *) orderOfAttributeKeys;
|
||||
- (NSArray *) orderOfValueKeys;
|
||||
|
||||
- (NSString *) versitString;
|
||||
|
||||
- (CardGroup *) searchParentOfClass: (Class) parentClass;
|
||||
|
||||
@@ -471,6 +471,16 @@ _orderedValuesAreVoid (NSArray *orderedValues)
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSArray *) orderOfAttributeKeys
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *) orderOfValueKeys
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *) versitString
|
||||
{
|
||||
NSString *string;
|
||||
|
||||
@@ -78,13 +78,17 @@
|
||||
if ([attributes count])
|
||||
{
|
||||
[rendering appendString: @";"];
|
||||
[attributes versitRenderInString: rendering asAttributes: YES];
|
||||
[attributes versitRenderInString: rendering
|
||||
withKeyOrdering: [anElement orderOfAttributeKeys]
|
||||
asAttributes: YES];
|
||||
}
|
||||
|
||||
/* values */
|
||||
values = [anElement values];
|
||||
[rendering appendString: @":"];
|
||||
[values versitRenderInString: rendering asAttributes: NO];
|
||||
[values versitRenderInString: rendering
|
||||
withKeyOrdering: [anElement orderOfValueKeys]
|
||||
asAttributes: NO];
|
||||
|
||||
if ([rendering length] > 0)
|
||||
[rendering appendString: @"\r\n"];
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
2012-04-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* iCalRecurrenceRule.m (-orderOfValueKeys): overrriden method.
|
||||
|
||||
* NSDictionary+NGCards.m
|
||||
(-versitRenderInString:withKeyOrdering:asAttributes:): now takes
|
||||
an "ordering" parameter resulting from the methods below and
|
||||
reorder the dictionary keys as specified.
|
||||
|
||||
* CardElement.m (-orderOfAttributeKeys, -orderOfValueKeys): new
|
||||
methods that return an ordered array of value keys, used for
|
||||
rendering data in a way that is acceptable to certain picky
|
||||
clients.
|
||||
|
||||
2012-04-11 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* iCalWeeklyRecurrenceCalculator.m
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
- (id) objectForCaseInsensitiveKey: (NSString *) aKey;
|
||||
|
||||
- (void) versitRenderInString: (NSMutableString *) aString
|
||||
withKeyOrdering: (NSArray *) ordering
|
||||
asAttributes: (BOOL) asAttribute; /* handling of ":" */
|
||||
|
||||
@end
|
||||
|
||||
@@ -123,15 +123,37 @@
|
||||
}
|
||||
|
||||
- (void) versitRenderInString: (NSMutableString *) aString
|
||||
withKeyOrdering: (NSArray *) ordering
|
||||
asAttributes: (BOOL) asAttributes
|
||||
{
|
||||
NSArray *keys;
|
||||
NSUInteger count, max, rendered = 0;
|
||||
NSMutableArray *keys;
|
||||
NSUInteger count, max, rendered = 0, keyIndex, newKeyIndex;
|
||||
NSArray *orderedValues;
|
||||
NSString *key;
|
||||
NSMutableString *substring;
|
||||
|
||||
keys = [self allKeys];
|
||||
keys = [[self allKeys] mutableCopy];
|
||||
[keys autorelease];
|
||||
|
||||
/* We reorder the fields based on the "ordering" array, by first placing
|
||||
those that are specified and then the rest of them. */
|
||||
newKeyIndex = 0;
|
||||
max = [ordering count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
key = [ordering objectAtIndex: count];
|
||||
keyIndex = [keys indexOfObject: key];
|
||||
if (keyIndex != NSNotFound)
|
||||
{
|
||||
if (keyIndex != newKeyIndex)
|
||||
{
|
||||
[keys removeObjectAtIndex: keyIndex];
|
||||
[keys insertObject: key atIndex: newKeyIndex];
|
||||
}
|
||||
newKeyIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
max = [keys count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
|
||||
@@ -854,6 +854,15 @@ NSString *iCalWeekDayString[] = { @"SU", @"MO", @"TU", @"WE", @"TH", @"FR",
|
||||
// }
|
||||
// }
|
||||
|
||||
/* versit key ordering */
|
||||
- (NSArray *) orderOfValueKeys
|
||||
{
|
||||
return [NSArray arrayWithObjects: @"freq", @"interval", @"count", @"until",
|
||||
@"bymonth", @"byweekno", @"byyearday", @"bymonthday",
|
||||
@"byday", @"byhour", @"byminute", @"bysecond", @"bysetpos",
|
||||
nil];
|
||||
}
|
||||
|
||||
/* key/value coding */
|
||||
|
||||
- (void) handleTakeValue: (id) _value
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
rule = [rules objectAtIndex:i];
|
||||
ruleString = [NSMutableString new];
|
||||
[[rule values] versitRenderInString: ruleString
|
||||
withKeyOrdering: [rule orderOfValueKeys]
|
||||
asAttributes: NO];
|
||||
[ma addObject: ruleString];
|
||||
[ruleString release];
|
||||
|
||||
Reference in New Issue
Block a user