Revision: 27577
          http://sourceforge.net/p/bibdesk/svn/27577
Author:   hofman
Date:     2022-06-07 15:10:35 +0000 (Tue, 07 Jun 2022)
Log Message:
-----------
use to-many accessor

Modified Paths:
--------------
    trunk/bibdesk/BDSKFindController.m

Modified: trunk/bibdesk/BDSKFindController.m
===================================================================
--- trunk/bibdesk/BDSKFindController.m  2022-06-07 14:50:58 UTC (rev 27576)
+++ trunk/bibdesk/BDSKFindController.m  2022-06-07 15:10:35 UTC (rev 27577)
@@ -884,7 +884,7 @@
                         newStr = nil;
                 }
                 if (newStr && (replFile = [[BDSKLinkedFile alloc] 
initWithURLString:newStr])) {
-                    [[bibItem mutableArrayValueForKey:@"files"] 
replaceObjectAtIndex:idx withObject:replFile];
+                    [bibItem replaceObjectInFilesAtIndex:idx 
withObject:replFile];
                     number++;
                     [replFile release];
                 }
@@ -949,7 +949,7 @@
                 if([theRegex findInString:origStr]){
                     origStr = [theRegex replaceWithString:replStr 
inString:origStr];
                     if ((replFile = [[BDSKLinkedFile alloc] 
initWithURLString:origStr])) {
-                        [[bibItem mutableArrayValueForKey:@"files"] 
replaceObjectAtIndex:idx withObject:replFile];
+                        [bibItem replaceObjectInFilesAtIndex:idx 
withObject:replFile];
                         number++;
                         [replFile release];
                     }
@@ -1010,13 +1010,11 @@
             BDSKLinkedFile *replFile;
             
             if ((replFile = [[BDSKLinkedFile alloc] 
initWithURLString:replStr])) {
-                if([remoteURLs count] == 0){
-                    if(shouldSetWhenEmpty == NO) {
-                        [replFile release];
-                        continue;
-                    }
-                }else{
+                if([remoteURLs count]){
                     [files removeObjectsInArray:remoteURLs];
+                } else if(shouldSetWhenEmpty == NO) {
+                    [replFile release];
+                    continue;
                 }
                 [files addObject:replFile];
                 number++;
@@ -1074,7 +1072,7 @@
                 if (idx == NSNotFound) continue;
                 origStr = [[file URL] absoluteString];
                 if ((replFile = [[BDSKLinkedFile alloc] 
initWithURLString:[replStr stringByAppendingString:origStr]])) {
-                    [[bibItem mutableArrayValueForKey:@"files"] 
replaceObjectAtIndex:idx withObject:replFile];
+                    [bibItem replaceObjectInFilesAtIndex:idx 
withObject:replFile];
                     number++;
                     [replFile release];
                 }
@@ -1129,7 +1127,7 @@
                 if (idx == NSNotFound) continue;
                 origStr = [[file URL] absoluteString];
                 if ((replFile = [[BDSKLinkedFile alloc] 
initWithURLString:[origStr stringByAppendingString:replStr]])) {
-                    [[bibItem mutableArrayValueForKey:@"files"] 
replaceObjectAtIndex:idx withObject:replFile];
+                    [bibItem replaceObjectInFilesAtIndex:idx 
withObject:replFile];
                     number++;
                     [replFile release];
                 }

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

Reply via email to