Revision: 22653
http://sourceforge.net/p/bibdesk/svn/22653
Author: hofman
Date: 2018-09-22 22:13:07 +0000 (Sat, 22 Sep 2018)
Log Message:
-----------
Add objects in reverse order, so we can add at the same index, so we won't over
count if objects fail to be added
Modified Paths:
--------------
trunk/bibdesk/BDSKAddCommand.m
Modified: trunk/bibdesk/BDSKAddCommand.m
===================================================================
--- trunk/bibdesk/BDSKAddCommand.m 2018-09-22 22:10:14 UTC (rev 22652)
+++ trunk/bibdesk/BDSKAddCommand.m 2018-09-22 22:13:07 UTC (rev 22653)
@@ -133,14 +133,14 @@
NSMutableArray *insertedObjects = [NSMutableArray array];
// insert using scripting KVC
if (insertionIndex >= 0) {
- for (id obj in insertionObjects) {
+ for (id obj in [insertionObjects
reverseObjectEnumerator]) {
if ([objects indexOfObjectIdenticalTo:obj] ==
NSNotFound) {
- [insertionContainer insertValue:obj
atIndex:insertionIndex++ inPropertyWithKey:insertionKey];
+ [insertionContainer insertValue:obj
atIndex:insertionIndex inPropertyWithKey:insertionKey];
[insertedObjects addObject:obj];
}
}
} else {
- for (id obj in insertionObjects) {
+ for (id obj in [insertionObjects
reverseObjectEnumerator]) {
if ([objects indexOfObjectIdenticalTo:obj] ==
NSNotFound) {
[insertionContainer insertValue:obj
inPropertyWithKey:insertionKey];
[insertedObjects addObject:obj];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit