Add code to instnatiate the NSTableCellView if the delegate method does not exist

This commit is contained in:
Gregory John Casamento 2024-02-11 00:11:13 -05:00
parent 74487bcfa5
commit b06b23c97c

View file

@ -3531,19 +3531,26 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
/* Draw the row between startingColumn and endingColumn */
for (i = startingColumn; i <= endingColumn; i++)
{
NSView *view = nil;
tb = [tableColumns objectAtIndex: i];
if ([delegate respondsToSelector: @selector(tableView:viewForTableColumn:row:)])
{
NSView *view = [delegate tableView: tableView
viewForTableColumn: tb
row: rowIndex];
NSDebugLog(@"View = %@", view);
drawingRect = [tableView frameOfCellAtColumn: i
row: rowIndex];
[view setFrame: drawingRect];
[tableView addSubview: view];
view = [delegate tableView: tableView
viewForTableColumn: tb
row: rowIndex];
}
else
{
view = AUTORELEASE([[NSTableCellView alloc] init]);
}
NSDebugLog(@"View = %@", view);
drawingRect = [tableView frameOfCellAtColumn: i
row: rowIndex];
[view setFrame: drawingRect];
[tableView addSubview: view];
}
}