diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-09-23 21:23:30 -0700 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-09-23 21:23:30 -0700 |
commit | 9d270bc10ef50c7c7965f7ae35965ce23b570220 (patch) | |
tree | 4b8f189fa7e44d25e6c2a4b0a4bbd82f3b26bd14 /src/objc/utils | |
parent | 9a16dedb6da5b3f6f952b5c4ce9b5f2155ab14f4 (diff) |
Fixed #395: fixed conversion between MCOIndexSet and NSIndexSet
Diffstat (limited to 'src/objc/utils')
-rw-r--r-- | src/objc/utils/MCOIndexSet.mm | 2 | ||||
-rw-r--r-- | src/objc/utils/NSIndexSet+MCO.m | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/objc/utils/MCOIndexSet.mm b/src/objc/utils/MCOIndexSet.mm index 28ca4078..9d75900f 100644 --- a/src/objc/utils/MCOIndexSet.mm +++ b/src/objc/utils/MCOIndexSet.mm @@ -152,7 +152,7 @@ MCO_SYNTHESIZE_NSCODING NSMutableIndexSet * result = [NSMutableIndexSet indexSet]; MCORange * allRanges = [self allRanges]; for(unsigned int i = 0 ; i < [self rangesCount] ; i ++) { - [result addIndexesInRange:NSMakeRange((NSUInteger) allRanges[i].location, (NSUInteger) allRanges[i].length)]; + [result addIndexesInRange:NSMakeRange((NSUInteger) allRanges[i].location, (NSUInteger) allRanges[i].length + 1)]; } return result; } diff --git a/src/objc/utils/NSIndexSet+MCO.m b/src/objc/utils/NSIndexSet+MCO.m index dd2b83d0..73b42c9a 100644 --- a/src/objc/utils/NSIndexSet+MCO.m +++ b/src/objc/utils/NSIndexSet+MCO.m @@ -16,7 +16,7 @@ MCOIndexSet * result = [MCOIndexSet indexSet];; [self enumerateRangesUsingBlock:^(NSRange range, BOOL * stop) { - [result addRange:MCORangeMake(range.location, range.length)]; + [result addRange:MCORangeMake(range.location, range.length - 1)]; }]; return result; |