Revision: 12288
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12288&view=rev
Author:   hofman
Date:     2008-01-05 12:30:48 -0800 (Sat, 05 Jan 2008)

Log Message:
-----------
Remove indexed scripting accessors for authors and editors, as those don't make 
sense. Authors in a document should only be accessed by name. Add accessors for 
the whole array, as you may want to get all authors or editors in a document.

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

Modified: trunk/bibdesk/BibDocument+Scripting.h
===================================================================
--- trunk/bibdesk/BibDocument+Scripting.h       2008-01-05 20:18:56 UTC (rev 
12287)
+++ trunk/bibdesk/BibDocument+Scripting.h       2008-01-05 20:30:48 UTC (rev 
12288)
@@ -50,14 +50,10 @@
 - (BDSKMacro *)valueInMacrosWithName:(NSString *)name;
 - (NSArray *)macros;
 
-- (unsigned int)countOfAuthors;
-- (BibAuthor *)objectInAuthorsAtIndex:(unsigned int)index;
-- (BibAuthor *)valueInAuthorsAtIndex:(unsigned int)index;
+- (NSArray *)authors;
 - (BibAuthor *)valueInAuthorsWithName:(NSString *)name;
 
-- (unsigned int)countOfEditors;
-- (BibAuthor *)objectInEditorsAtIndex:(unsigned int)index;
-- (BibAuthor *)valueInEditorsAtIndex:(unsigned int)index;
+- (NSArray *)editors;
 - (BibAuthor *)valueInEditorsWithName:(NSString *)name;
 
 - (NSArray*) selection;

Modified: trunk/bibdesk/BibDocument+Scripting.m
===================================================================
--- trunk/bibdesk/BibDocument+Scripting.m       2008-01-05 20:18:56 UTC (rev 
12287)
+++ trunk/bibdesk/BibDocument+Scripting.m       2008-01-05 20:30:48 UTC (rev 
12288)
@@ -190,28 +190,12 @@
        return macros;
 }
 
-- (unsigned int)countOfAuthors {
+- (NSArray *)authors {
        NSMutableSet *auths = [NSMutableSet set];
-       
     [auths performSelector:@selector(addObjectsFromArray:) 
withObjectsByMakingObjectsFromArray:publications 
performSelector:@selector(pubAuthors)];
-       
-       return [auths count];
+       return [auths allObjects];
 }
 
-- (BibAuthor *)objectInAuthorsAtIndex:(unsigned int)idx {
-       NSMutableSet *auths = [NSMutableSet set];
-       
-    [auths performSelector:@selector(addObjectsFromArray:) 
withObjectsByMakingObjectsFromArray:publications 
performSelector:@selector(pubAuthors)];
-       
-       if (idx < [auths count]) 
-               return [[auths allObjects] objectAtIndex:idx];
-       return nil;
-}
-
-- (BibAuthor *)valueInAuthorsAtIndex:(unsigned int)idx {
-    return [self objectInAuthorsAtIndex:idx];
-}
-
 - (BibAuthor *)valueInAuthorsWithName:(NSString*) name {
     // create a new author so we can use BibAuthor's isEqual: method for 
comparison
     // instead of trying to do string comparisons
@@ -236,28 +220,12 @@
        return author;
 }
 
-- (unsigned int)countOfEditors {
+- (NSArray *)editors {
        NSMutableSet *auths = [NSMutableSet set];
-       
     [auths performSelector:@selector(addObjectsFromArray:) 
withObjectsByMakingObjectsFromArray:publications 
performSelector:@selector(pubEditors)];
-       
-       return [auths count];
+       return [auths allObjects];
 }
 
-- (BibAuthor *)objectInEditorsAtIndex:(unsigned int)idx {
-       NSMutableSet *auths = [NSMutableSet set];
-       
-    [auths performSelector:@selector(addObjectsFromArray:) 
withObjectsByMakingObjectsFromArray:publications 
performSelector:@selector(pubEditors)];
-       
-       if (idx < [auths count]) 
-               return [[auths allObjects] objectAtIndex:idx];
-       return nil;
-}
-
-- (BibAuthor *)valueInEditorsAtIndex:(unsigned int)idx {
-    return [self objectInEditorsAtIndex:idx];
-}
-
 - (BibAuthor *)valueInEditorsWithName:(NSString*) name {
     // create a new author so we can use BibAuthor's isEqual: method for 
comparison
     // instead of trying to do string comparisons


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to