Fixed: the "fix for column reordering with hidden columns" sometimes caused the table view to try to remove nonexistent data views and crash. The fix is to consider a nonexistent data view already removed and just move on.

This commit is contained in:
Alexander Ljungberg
2010-08-11 23:33:21 -04:00
parent 1fed798120
commit 233df3bdab
+10 -5
View File
@@ -2277,9 +2277,14 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
for (; rowIndex < rowsCount; ++rowIndex)
{
var row = rowArray[rowIndex],
dataView = [_dataViewsForTableColumns[tableColumnUID] objectAtIndex:row];
dataViews = _dataViewsForTableColumns[tableColumnUID];
[_dataViewsForTableColumns[tableColumnUID] replaceObjectAtIndex:row withObject:nil];
if (!dataViews || row >= dataViews.length)
continue;
var dataView = [dataViews objectAtIndex:row];
[dataViews replaceObjectAtIndex:row withObject:nil];
[self _enqueueReusableDataView:dataView];
}
@@ -3722,14 +3727,14 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey",
CGContextSetStrokeColor(context, _lineColor);
var points = [
_CGPointMake(0.5, 0),
_CGPointMake(0.5, 0),
_CGPointMake(0.5, aRect.size.height)
];
CGContextStrokeLineSegments(context, points, 2);
points = [
_CGPointMake(aRect.size.width - 0.5, 0),
_CGPointMake(aRect.size.width - 0.5, 0),
_CGPointMake(aRect.size.width - 0.5, aRect.size.height)
];