diff --git a/ChangeLog b/ChangeLog index 4f9fbb640..abf1ff4bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-11-02 Richard Frith-Macdonald + + * Source/NSOutlineView.m: + The _expandedItems array needs to be managed using tests for identical + members rather than equal members, to handle the case where a view has + multiple equal members (we don't want all equal items expanded, only + the exact item. + 2015-11-01 Richard Frith-Macdonald * Source/GNUmakefile.preamble: diff --git a/Source/NSOutlineView.m b/Source/NSOutlineView.m index db3c19e17..1eaffbf1a 100644 --- a/Source/NSOutlineView.m +++ b/Source/NSOutlineView.m @@ -432,7 +432,11 @@ static NSImage *unexpandable = nil; return YES; } // Check the array to determine if it is expanded. - return([_expandedItems containsObject: item]); + if ([_expandedItems indexOfObjectIdenticalTo: item] == NSNotFound) + { + return NO; + } + return YES; } /** @@ -2078,7 +2082,7 @@ Also returns the child index relative to this parent. */ // close the item... if (item != nil) { - [_expandedItems removeObject: item]; + [_expandedItems removeObjectIdenticalTo: item]; } // For the close method it doesn't matter what order they are @@ -2167,7 +2171,7 @@ Also returns the child index relative to this parent. */ [self _removeChildren: child]; NSMapRemove(_itemDict, child); [_items removeObject: child]; - [_expandedItems removeObject: child]; + [_expandedItems removeObjectIdenticalTo: child]; } [anarray removeAllObjects]; [self _noteNumberOfRowsChangedBelowItem: startitem by: -numChildren];