mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-09 18:30:59 +00:00
CPArrayController -setContent: fixed a bug where objects where not rearranged if clearsFilterPredicateOnInsertion == YES and filterPredicate == nil.
This commit is contained in:
1 parent
66a87c472b
commit
59cc590b51
2 files changed
+13
-3
No files matched your search
@@ -1,5 +1,6 @@
|
||||
|
||||
@import <AppKit/CPArrayController.j>
|
||||
@import <AppKit/CPTextField.j>
|
||||
|
||||
@implementation CPArrayControllerTest : OJTestCase
|
||||
{
|
||||
@@ -190,8 +191,7 @@
|
||||
|
||||
[arrayController setContent:newContent];
|
||||
|
||||
[self assert:[CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, 2)] equals:[arrayController selectionIndexes]
|
||||
message:@"last object cannot be selected"];
|
||||
[self assert:[CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, 2)] equals:[arrayController selectionIndexes] message:@"last object cannot be selected"];
|
||||
}
|
||||
|
||||
- (void)testContentBinding
|
||||
@@ -354,6 +354,16 @@
|
||||
[self assert:@"Building 1" equals:[[self arrayController] valueForKeyPath:@"selection.department.building"]];
|
||||
}
|
||||
|
||||
- (void)testArrangedObjectsNotEmptyAfterSetContentWhenClearsFilterOnInsertionIsTrue
|
||||
{
|
||||
var arrayController = [[CPArrayController alloc] init];
|
||||
[arrayController setFilterPredicate:nil];
|
||||
[arrayController setClearsFilterPredicateOnInsertion:YES];
|
||||
[arrayController setContent:[CPArray arrayWithObject:@"a"]];
|
||||
|
||||
[self assertTrue:[[arrayController arrangedObjects] count] > 0];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:keyPath
|
||||
ofObject:anActivity
|
||||
change:change
|
||||
|
||||
Reference in new issue
Block a user