Bounds errors on rectOfColumn

This commit is contained in:
Randall Luecke
2010-12-27 01:25:32 -06:00
parent e31af96ef9
commit f64cc4c655
+5 -1
View File
@@ -1499,15 +1499,19 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
// O(1)
/*!
Returns a CGRect with the location and size of the column
If aColumnIndex lies outside the range of the table columns a CGZeroRect is returned
@param aColumnIndex the index of the column you want the rect of
*/
- (CGRect)rectOfColumn:(CPInteger)aColumnIndex
{
aColumnIndex = +aColumnIndex;
if (aColumnIndex < 0 || aColumnIndex >= NUMBER_OF_COLUMNS())
return _CGRectMakeZero();
var column = [[self tableColumns] objectAtIndex:aColumnIndex];
if ([column isHidden] || aColumnIndex < 0 || aColumnIndex >= NUMBER_OF_COLUMNS())
if ([column isHidden])
return _CGRectMakeZero();
UPDATE_COLUMN_RANGES_IF_NECESSARY();