Monotone-Parent: a2e22f9ca9e5096f59327f5b4d176050ffcbf15f

Monotone-Revision: 00622e0c5fa34a4e5e98835bf4037dc6f562e342

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-11-22T16:19:11
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-11-22 16:19:11 +00:00
parent fc74f8f24f
commit 68b4fe07be
2 changed files with 32 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
2007-11-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* iCalEntityObject.m ([iCalEntityObject -compare:otherObject]):
safely compare between objects which may be nil.
2007-11-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* iCalPerson.m ([-rsvp]): return lowercase string.

View File

@@ -425,13 +425,38 @@
return nil; /* not found */
}
- (NSComparisonResult) _compareValue: (id) selfValue
withValue: (id) otherValue
{
NSComparisonResult result;
if (selfValue)
{
if (otherValue)
result = [selfValue compare: otherValue];
else
result = NSOrderedDescending;
}
else
{
if (otherValue)
result = NSOrderedAscending;
else
result = NSOrderedSame;
}
return result;
}
- (NSComparisonResult) _compareVersions: (iCalEntityObject *) otherObject
{
NSComparisonResult result;
result = [[self sequence] compare: [otherObject sequence]];
result = [self _compareValue: [self sequence]
withValue: [otherObject sequence]];
if (result == NSOrderedSame)
result = [[self lastModified] compare: [otherObject lastModified]];
result = [self _compareValue: [self lastModified]
withValue: [otherObject lastModified]];
return result;
}