Monotone-Parent: f4a48c355ec45a380e52409f4443bd4198ea038a

Monotone-Revision: 2067a16090e68b1eac6c1e860f41b09c466ff2f5

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-08-21T21:40:28
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-08-21 21:40:28 +00:00
parent d9c815dc40
commit be982cdc35
3 changed files with 18 additions and 4 deletions
+3 -1
View File
@@ -206,7 +206,7 @@
[self addObject: NSStringFromRange (newRange)];
}
- (BOOL) hasRangeIntersection: (NSRange) testRange
- (BOOL) hasRangeIntersection: (NSRange) testRange withOffset: (unsigned int) offset
{
NSEnumerator *ranges;
NSString *currentRangeString;
@@ -217,9 +217,11 @@
ranges = [self objectEnumerator];
currentRangeString = [ranges nextObject];
while (!response && currentRangeString)
{
currentRange = NSRangeFromString (currentRangeString);
currentRange.location = currentRange.location + offset;
if (NSLocationInRange (testRange.location, currentRange)
|| NSLocationInRange (NSMaxRange (testRange), currentRange))
response = YES;