Move check for dataSource or binding into NSOutlineView before calling method to draw the row per discussion with @fredkiefer

This commit is contained in:
Gregory John Casamento 2024-07-27 18:29:00 -04:00
parent 3d59afd2c9
commit abfc782a6c
2 changed files with 10 additions and 9 deletions

View file

@ -3534,15 +3534,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
NSInteger i;
id dataSource = [outlineView dataSource];
NSTableColumn *outlineTableColumn = [outlineView outlineTableColumn];
GSKeyValueBinding *theBinding = nil;
theBinding = [GSKeyValueBinding getBinding: NSContentBinding
forObject: outlineView];
if (dataSource == nil && theBinding == nil)
{
return;
}
/* Using columnAtPoint: here would make it called twice per row per drawn
rect - so we avoid it and do it natively */

View file

@ -1032,6 +1032,16 @@ static NSImage *unexpandable = nil;
*/
- (void) drawRow: (NSInteger)rowIndex clipRect: (NSRect)aRect
{
GSKeyValueBinding *theBinding = nil;
theBinding = [GSKeyValueBinding getBinding: NSContentBinding
forObject: self];
if (_dataSource == nil && theBinding == nil)
{
return;
}
if (_viewBased)
{
[self _drawCellViewRow: rowIndex