From 15be647c167cd3a36286691e77ac796e0c4e7e8b Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sun, 14 Feb 2010 23:35:17 -0300 Subject: [PATCH] Fixed: the CPArrayController code to remove out of bounds selections failed to remove the last selected item if the new arrangedObjects array was empty. --- AppKit/CPArrayController.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPArrayController.j b/AppKit/CPArrayController.j index f61bd2c26..19fc44fe8 100644 --- a/AppKit/CPArrayController.j +++ b/AppKit/CPArrayController.j @@ -310,7 +310,7 @@ { var objectsCount = [[self arrangedObjects] count]; // Remove out of bounds indexes. - [indexes removeIndexesInRange:CPMakeRange(objectsCount, [indexes lastIndex])]; + [indexes removeIndexesInRange:CPMakeRange(objectsCount, [indexes lastIndex]+1)]; // When avoiding empty selection and the deleted selection was at the bottom, select the last item. if(![indexes count] && _avoidsEmptySelection && objectsCount) indexes = [CPIndexSet indexSetWithIndex:objectsCount-1];