mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 20:50:44 +00:00
Encapsulate the renderedPaths and pathsToViews ivars that track which views were displayed in a viewBased table
This commit is contained in:
parent
c1e3cf2f08
commit
3ff5efed30
2 changed files with 11 additions and 13 deletions
|
@ -82,8 +82,8 @@
|
|||
row: (NSInteger)index;
|
||||
- (id)_objectValueForTableColumn: (NSTableColumn *)tb
|
||||
row: (NSInteger)index;
|
||||
- (NSMapTable *) _renderedViewPaths;
|
||||
- (NSMapTable *) _pathsToViews;
|
||||
- (NSView *) _renderedViewForPath: (NSIndexPath *)path;
|
||||
- (void) _setRenderedView: (NSView *)view forPath: (NSIndexPath *)path;
|
||||
@end
|
||||
|
||||
@interface NSTableColumn (Private)
|
||||
|
@ -3703,9 +3703,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
NSTableColumn *tb = [tableColumns objectAtIndex: i];
|
||||
NSIndexPath *path = [NSIndexPath indexPathForItem: i
|
||||
inSection: rowIndex];
|
||||
NSMapTable *paths = [v _renderedViewPaths];
|
||||
NSMapTable *views = [v _pathsToViews];
|
||||
NSView *view = [paths objectForKey: path];
|
||||
NSView *view = [v _renderedViewForPath: path];
|
||||
|
||||
if (ov != nil)
|
||||
{
|
||||
|
@ -3784,8 +3782,8 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
view = [view copy]; // instantiate the prototype...
|
||||
}
|
||||
}
|
||||
|
||||
[paths setObject: view forKey: path];
|
||||
|
||||
[ov _setRenderedView: view forPath: path];
|
||||
[ov addSubview: view];
|
||||
}
|
||||
}
|
||||
|
@ -3814,8 +3812,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
}
|
||||
|
||||
// Store the object...
|
||||
[paths setObject: view forKey: path];
|
||||
[views setObject: path forKey: view];
|
||||
[v _setRenderedView: view forPath: path];
|
||||
[v addSubview: view];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7138,14 +7138,15 @@ For a more detailed explanation, -setSortDescriptors:. */
|
|||
}
|
||||
}
|
||||
|
||||
- (NSMapTable *) _renderedViewPaths
|
||||
- (NSView *) _renderedViewForPath: (NSIndexPath *)path
|
||||
{
|
||||
return _renderedViewPaths;
|
||||
return [_renderedViewPaths objectForKey: path];
|
||||
}
|
||||
|
||||
- (NSMapTable *) _pathsToViews
|
||||
- (void) _setRenderedView: (NSView *)view forPath: (NSIndexPath *)path
|
||||
{
|
||||
return _pathsToViews;
|
||||
[_renderedViewPaths setObject: view forKey: path];
|
||||
[_pathsToViews setObject: path forKey: view];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue