From a3d89c8d7854e6fa0d0afb7868c781fcec1bddc3 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Mon, 23 Aug 2010 18:51:00 -0400 Subject: [PATCH] Ignore table view row selection of already selected rows. This avoids potential infinite recursion caused by the explicit bindings propagation. --- AppKit/CPTableView.j | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 005920d36..a602c5bb4 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -880,7 +880,10 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5; - (void)_setSelectedRowIndexes:(CPIndexSet)rows { - var previousSelectedIndexes = [_selectedRowIndexes copy]; + if ([_selectedRowIndexes isEqualToIndexSet:rows]) + return; + + var previousSelectedIndexes = _selectedRowIndexes; _lastSelectedRow = ([rows count] > 0) ? [rows lastIndex] : -1; _selectedRowIndexes = [rows copy]; @@ -3574,7 +3577,7 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey", [aCoder encodeInt:_selectionHighlightStyle forKey:CPTableViewSelectionHighlightStyleKey]; [aCoder encodeInt:_columnAutoResizingStyle forKey:CPTableViewColumnAutoresizingStyleKey]; - + [aCoder encodeBool:_allowsMultipleSelection forKey:CPTableViewMultipleSelectionKey]; [aCoder encodeBool:_allowsEmptySelection forKey:CPTableViewEmptySelectionKey]; [aCoder encodeBool:_allowsColumnReordering forKey:CPTableViewColumnReorderingKey];