From 4f946f267ef7a4c94a05dd88acdc41a8ade2ba19 Mon Sep 17 00:00:00 2001 From: Klaas Pieter Annema Date: Mon, 26 Jul 2010 18:34:13 +0200 Subject: [PATCH] fix CPArrayController removeObject: removeObject: only shifted the selection, it never actually removes the object --- AppKit/CPArrayController.j | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AppKit/CPArrayController.j b/AppKit/CPArrayController.j index c11206f79..ad40efcd2 100644 --- a/AppKit/CPArrayController.j +++ b/AppKit/CPArrayController.j @@ -426,12 +426,14 @@ [_contentObject removeObject:object]; [self didChangeValueForKey:@"content"]; - if ([_filterPredicate evaluateWithObject:object]) + if (_filterPredicate === nil || [_filterPredicate evaluateWithObject:object]) { [self willChangeValueForKey:@"selectionIndexes"]; var pos = [_arrangedObjects indexOfObject:object]; + [_arrangedObjects removeObjectAtIndex:pos]; [_selectionIndexes shiftIndexesStartingAtIndex:pos by:-1]; + [self didChangeValueForKey:@"selectionIndexes"]; } }