mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Eliminate category, move logic for prepend inline
This commit is contained in:
parent
300a84c493
commit
a1b9dc546e
1 changed files with 14 additions and 29 deletions
|
@ -1740,34 +1740,6 @@ Also returns the child index relative to this parent. */
|
|||
|
||||
@end /* implementation of NSOutlineView */
|
||||
|
||||
@interface NSIndexPath (__NSOutlineView__Prepend__)
|
||||
|
||||
- (NSIndexPath *) _indexPathByPrependingIndex: (NSUInteger)index;
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSIndexPath (__NSOutlineView__Prepend__)
|
||||
|
||||
- (NSIndexPath *) _indexPathByPrependingIndex: (NSUInteger)index
|
||||
{
|
||||
NSIndexPath *newPath = [NSIndexPath indexPathWithIndex: index];
|
||||
NSUInteger length = [self length];
|
||||
NSUInteger indexes[length + 1];
|
||||
NSUInteger i = 0;
|
||||
|
||||
[self getIndexes: indexes];
|
||||
|
||||
// Iterate over existing indexes...
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
newPath = [newPath indexPathByAddingIndex: indexes[i]];
|
||||
}
|
||||
|
||||
return newPath;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSOutlineView (NotificationRequestMethods)
|
||||
|
||||
- (NSIndexPath *) _findIndexPathForItem: (id)item
|
||||
|
@ -1792,7 +1764,20 @@ Also returns the child index relative to this parent. */
|
|||
|
||||
if (foundPath != nil)
|
||||
{
|
||||
return [foundPath _indexPathByPrependingIndex: index];
|
||||
NSIndexPath *newPath = [NSIndexPath indexPathWithIndex: index];
|
||||
NSUInteger length = [foundPath length];
|
||||
NSUInteger indexes[length + 1];
|
||||
NSUInteger i = 0;
|
||||
|
||||
[foundPath getIndexes: indexes];
|
||||
|
||||
// Iterate over existing indexes...
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
newPath = [newPath indexPathByAddingIndex: indexes[i]];
|
||||
}
|
||||
|
||||
return newPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue