From f64cc4c655bbfeee18f2d100e3f544198f12fa71 Mon Sep 17 00:00:00 2001 From: Randall Luecke Date: Mon, 27 Dec 2010 01:25:32 -0600 Subject: [PATCH] Bounds errors on rectOfColumn --- AppKit/CPTableView.j | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index cc8aab696..ebceefbea 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -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();