mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-21 06:33:18 +00:00
Monotone-Parent: b54cbfbf869e5f43716f3c46ec9c9461fca6684f
Monotone-Revision: 13b85b286011f096c4141829b528972047581e57 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-30T20:03:19 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -91,5 +91,34 @@
|
||||
[self addObject: object];
|
||||
}
|
||||
|
||||
- (void) addRange: (NSRange) newRange
|
||||
{
|
||||
[self addObject: NSStringFromRange (newRange)];
|
||||
}
|
||||
|
||||
- (BOOL) hasRangeIntersection: (NSRange) testRange
|
||||
{
|
||||
NSEnumerator *ranges;
|
||||
NSString *currentRangeString;
|
||||
NSRange currentRange;
|
||||
BOOL response;
|
||||
|
||||
response = NO;
|
||||
|
||||
ranges = [self objectEnumerator];
|
||||
currentRangeString = [ranges nextObject];
|
||||
while (!response && currentRangeString)
|
||||
{
|
||||
currentRange = NSRangeFromString (currentRangeString);
|
||||
if (NSLocationInRange (testRange.location, currentRange)
|
||||
|| NSLocationInRange (NSMaxRange (testRange), currentRange))
|
||||
response = YES;
|
||||
else
|
||||
currentRangeString = [ranges nextObject];
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user