From 2974bdc1d76d9b46091f0ce5a06b3bbca74ff56a Mon Sep 17 00:00:00 2001 From: Andrew Hankinson Date: Fri, 19 Apr 2013 16:45:40 -0400 Subject: [PATCH] Fix formatting and enumerator problems --- AppKit/CPTableView.j | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 67f837d51..1d5cba52d 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -5236,6 +5236,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad if (_implementedDelegateMethods & CPTableViewDelegate_tableView_shouldSelectRow_) { var shouldSelect = [_delegate tableView:self shouldSelectRow:i]; + if (!shouldSelect) { /* If shouldSelect returns NO it means this row cannot be selected. @@ -5244,10 +5245,11 @@ Your delegate can implement this method to avoid subclassing the tableview to ad */ while (!shouldSelect && (i < [self numberOfRows] && i > 0)) { - shouldGoUpward ? i-- : i++; //check to see if the row can be selected if it can't be then see if the next row can be selected + shouldGoUpward ? --i : ++i; //check to see if the row can be selected if it can't be then see if the next row can be selected shouldSelect = [_delegate tableView:self shouldSelectRow:i]; } } + } // If we go upward and see that this row is already selected we should deselect the row below.