From b26b0a321b288c61b7f28dde603714edd4e72adc Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Fri, 27 Jan 2012 14:54:10 +0000 Subject: [PATCH] Reinstate defensive coding for numeric parameters in CPTableView. --- AppKit/CPTableView.j | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index a81a473bf..e1ffeb2b1 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -683,7 +683,8 @@ NOT YET IMPLEMENTED */ - (void)setRowHeight:(unsigned)aRowHeight { - aRowHeight = aRowHeight; + // Accept row heights such as "0". + aRowHeight = +aRowHeight; if (_rowHeight === aRowHeight) return; @@ -954,8 +955,9 @@ NOT YET IMPLEMENTED */ - (void)_moveColumn:(unsigned)fromIndex toColumn:(unsigned)toIndex { - fromIndex = fromIndex; - toIndex = toIndex; + // Convert parameters such as "0" to 0. + fromIndex = +fromIndex; + toIndex = +toIndex; if (fromIndex === toIndex) return; @@ -1562,7 +1564,8 @@ NOT YET IMPLEMENTED */ - (CGRect)rectOfColumn:(CPInteger)aColumnIndex { - aColumnIndex = aColumnIndex; + // Convert e.g. "0" to 0. + aColumnIndex = +aColumnIndex; if (aColumnIndex < 0 || aColumnIndex >= NUMBER_OF_COLUMNS()) return _CGRectMakeZero();