mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-08 11:47:14 +00:00
Fixed ArrayController failed to recognize row 0 as the insert location
The logic is wrong in the test for last selection since it can be 0 and if there is no selection, [_selectionIndexes lastIndex] returns -1 Fixes #1723
This commit is contained in:
committed by
Antoine Mercadal
parent
c8b812bbb5
commit
009ae1e14c
@@ -914,7 +914,7 @@
|
||||
var newObject = [self automaticallyPreparesContent] ? [self newObject] : [self _defaultNewObject],
|
||||
lastSelectedIndex = [_selectionIndexes lastIndex];
|
||||
|
||||
if (lastSelectedIndex)
|
||||
if (lastSelectedIndex != CPNotFound)
|
||||
[self insertObject:newObject atArrangedObjectIndex:lastSelectedIndex];
|
||||
else
|
||||
[self addObject:newObject];
|
||||
|
||||
Reference in New Issue
Block a user