mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-31 04:17:36 +00:00
fixed: CPOutlineView and CPTableView corner cases
This commit is contained in:
1 parent
40cdc9108a
commit
1878967da1
2 files changed
+21
-4
No files matched your search
+12
-4
@@ -1515,8 +1515,12 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
|
||||
{
|
||||
if (_disclosureControlsForRows.length)
|
||||
{
|
||||
var indexes = [_selectedRowIndexes copy];
|
||||
[indexes removeIndexesInRange:CPMakeRange(_disclosureControlsForRows.length, _itemsForRows.length - _disclosureControlsForRows.length)];
|
||||
var indexes = [_selectedRowIndexes copy],
|
||||
diff = _itemsForRows.length - _disclosureControlsForRows.length;
|
||||
|
||||
if (diff > 0)
|
||||
[indexes removeIndexesInRange:CPMakeRange(_disclosureControlsForRows.length, diff)];
|
||||
|
||||
[[_disclosureControlsForRows objectsAtIndexes:indexes] makeObjectsPerformSelector:@selector(unsetThemeState:) withObject:CPThemeStateSelected];
|
||||
}
|
||||
|
||||
@@ -1524,8 +1528,12 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
|
||||
|
||||
if (_disclosureControlsForRows.length)
|
||||
{
|
||||
var indexes = [_selectedRowIndexes copy];
|
||||
[indexes removeIndexesInRange:CPMakeRange(_disclosureControlsForRows.length, _itemsForRows.length - _disclosureControlsForRows.length)];
|
||||
var indexes = [_selectedRowIndexes copy],
|
||||
diff = _itemsForRows.length - _disclosureControlsForRows.length;
|
||||
|
||||
if (diff > 0)
|
||||
[indexes removeIndexesInRange:CPMakeRange(_disclosureControlsForRows.length, diff)];
|
||||
|
||||
[[_disclosureControlsForRows objectsAtIndexes:indexes] makeObjectsPerformSelector:@selector(setThemeState:) withObject:CPThemeStateSelected];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2092,6 +2092,9 @@ NOT YET IMPLEMENTED
|
||||
if (lastRow < 0)
|
||||
lastRow = _numberOfRows - 1;
|
||||
|
||||
if (firstRow > lastRow)
|
||||
return CPMakeRange(0, 0);
|
||||
|
||||
return CPMakeRange(firstRow, lastRow - firstRow + 1);
|
||||
}
|
||||
|
||||
@@ -2130,12 +2133,18 @@ NOT YET IMPLEMENTED
|
||||
// O(log numberOfColumns) if table view contains no hidden columns
|
||||
// O(numberOfColumns) if table view contains hidden columns
|
||||
|
||||
if (NUMBER_OF_COLUMNS() === 0)
|
||||
return [CPIndexSet indexSet];
|
||||
|
||||
var column = MAX(0, [self columnAtPoint:CGPointMake(aRect.origin.x, 0.0)]),
|
||||
lastColumn = [self columnAtPoint:CGPointMake(CGRectGetMaxX(aRect), 0.0)];
|
||||
|
||||
if (lastColumn === CPNotFound)
|
||||
lastColumn = NUMBER_OF_COLUMNS() - 1;
|
||||
|
||||
if (column > lastColumn || lastColumn < 0)
|
||||
return [CPIndexSet indexSet];
|
||||
|
||||
// Don't bother doing the expensive removal of hidden indexes if we have no hidden columns.
|
||||
if (_numberOfHiddenColumns <= 0)
|
||||
return [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(column, lastColumn - column + 1)];
|
||||
|
||||
Reference in new issue
Block a user