From eb04174e682dc2d62ff358490472579d3ea4709a Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Mon, 6 May 2013 15:07:26 -0700 Subject: [PATCH] Revert "Merge branch 'outlineViewDisclosureSelectedThemestate' of https://github.com/BlairDuncan/cappuccino into pr-1917" This reverts commit 345a54e8c911e2e090c5bf0c5d3a7cbf262af466, reversing changes made to 21301cae21013ba63d5a486cdac7c82be1be8f1b. This commit is reverted because it causes a non obvious crash when selecting the latest row of a CPOutlineView. The crash is visible in Tests/Manual/CPOutlineViewTest --- AppKit/CPOutlineView.j | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/AppKit/CPOutlineView.j b/AppKit/CPOutlineView.j index eeefbfd3a..bc69b5d3f 100644 --- a/AppKit/CPOutlineView.j +++ b/AppKit/CPOutlineView.j @@ -721,17 +721,16 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0, /*! @ignore - Select or deselect rows, this is overridden because we need to change the color of the outline control. + Select or deselect rows, this is overridden because we need to change the color or the outline control. */ -- (void)_setSelectedRowIndexes:(CPIndexSet)rows +- (void)_performSelection:(BOOL)select forRow:(CPInteger)rowIndex context:(id)context { - if (_disclosureControlsForRows.length) - [[_disclosureControlsForRows objectsAtIndexes:_selectedRowIndexes] makeObjectsPerformSelector:@selector(unsetThemeState:) withObject:CPThemeStateSelected]; + [super _performSelection:select forRow:rowIndex context:context]; - [super _setSelectedRowIndexes:rows]; + var control = _disclosureControlsForRows[rowIndex], + selector = select ? @"setThemeState:" : @"unsetThemeState:"; - if (_disclosureControlsForRows.length) - [[_disclosureControlsForRows objectsAtIndexes:_selectedRowIndexes] makeObjectsPerformSelector:@selector(setThemeState:) withObject:CPThemeStateSelected]; + [control performSelector:CPSelectorFromString(selector) withObject:CPThemeStateSelected]; } /*!