Revision: 22626
          http://sourceforge.net/p/bibdesk/svn/22626
Author:   hofman
Date:     2018-09-17 14:52:16 +0000 (Mon, 17 Sep 2018)
Log Message:
-----------
Use cached groups to find pubs for an author, implement in place

Modified Paths:
--------------
    trunk/bibdesk/BDSKPublicationsArray.h
    trunk/bibdesk/BDSKPublicationsArray.m
    trunk/bibdesk/BibAuthor+Scripting.m

Modified: trunk/bibdesk/BDSKPublicationsArray.h
===================================================================
--- trunk/bibdesk/BDSKPublicationsArray.h       2018-09-17 14:44:22 UTC (rev 
22625)
+++ trunk/bibdesk/BDSKPublicationsArray.h       2018-09-17 14:52:16 UTC (rev 
22626)
@@ -38,7 +38,7 @@
 
 #import <Cocoa/Cocoa.h>
 
-@class BibItem, BibAuthor;
+@class BibItem;
 
 @interface BDSKPublicationsArray : NSMutableArray {
     NSMutableArray *publications;
@@ -55,6 +55,5 @@
 
 - (id)itemForIdentifierURL:(NSURL *)aURL;
 - (NSArray *)itemsForIdentifierURLs:(NSArray *)anArray;
-- (NSArray *)itemsForPerson:(BibAuthor *)aPerson forField:(NSString *)field;
 
 @end

Modified: trunk/bibdesk/BDSKPublicationsArray.m
===================================================================
--- trunk/bibdesk/BDSKPublicationsArray.m       2018-09-17 14:44:22 UTC (rev 
22625)
+++ trunk/bibdesk/BDSKPublicationsArray.m       2018-09-17 14:52:16 UTC (rev 
22626)
@@ -276,24 +276,6 @@
     return array;
 }
 
-#pragma mark Authors support
-
-- (NSArray *)itemsForPerson:(BibAuthor *)aPerson forField:(NSString *)field;
-{
-    NSMutableSet *auths = [[NSMutableSet alloc] initForFuzzyAuthors];
-    NSMutableArray *thePubs = [NSMutableArray array];
-    
-    for (BibItem *bi in publications) {
-        [auths addObjectsFromArray:[bi peopleArrayForField:field]];
-        if([auths containsObject:aPerson]){
-            [thePubs addObject:bi];
-        }
-        [auths removeAllObjects];
-    }
-    [auths release];
-    return thePubs;
-}
-
 @end
 
 

Modified: trunk/bibdesk/BibAuthor+Scripting.m
===================================================================
--- trunk/bibdesk/BibAuthor+Scripting.m 2018-09-17 14:44:22 UTC (rev 22625)
+++ trunk/bibdesk/BibAuthor+Scripting.m 2018-09-17 14:52:16 UTC (rev 22626)
@@ -100,10 +100,14 @@
 
 - (NSArray *)scriptingPublications {
        id owner = [[self publication] owner];
-       if (owner) {
-        return [[owner publications] itemsForPerson:self forField:field ?: 
BDSKAuthorString];
+    NSMutableArray *pubs = [NSMutableArray array];
+       if (owner && field) {
+        for (BibItem *pub in [owner publications]) {
+            if([pub isContainedInGroupNamed:self forField:field])
+                [pubs addObject:pub];
+        }
        }
-    return [NSArray array];
+    return pubs;
 }
 
 - (BOOL)isExternal {

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