Revision: 17977
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=17977&view=rev
Author: hofman
Date: 2011-06-27 19:13:18 +0000 (Mon, 27 Jun 2011)
Log Message:
-----------
remove a method that can be avoided, for symmetry and simpler API
Modified Paths:
--------------
trunk/bibdesk/BibDocument+Scripting.m
trunk/bibdesk/BibDocument.h
trunk/bibdesk/BibDocument.m
Modified: trunk/bibdesk/BibDocument+Scripting.m
===================================================================
--- trunk/bibdesk/BibDocument+Scripting.m 2011-06-27 16:58:21 UTC (rev
17976)
+++ trunk/bibdesk/BibDocument+Scripting.m 2011-06-27 19:13:18 UTC (rev
17977)
@@ -332,7 +332,7 @@
- (void)insertObject:(BibItem *)pub
inScriptingPublicationsAtIndex:(NSUInteger)idx {
if ([pub macroResolver] == nil || [pub macroResolver] == macroResolver)
{
- [self insertPublication:pub atIndex:idx];
+ [self insertPublications:[NSArray arrayWithObjects:pub, nil]
atIndexes:[NSIndexSet indexSetWithIndex:idx]];
[[self undoManager]
setActionName:NSLocalizedString(@"AppleScript",@"Undo action name for
AppleScript")];
} else if ([[pub owner] isEqual:self] == NO) {
NSScriptCommand *cmd = [NSScriptCommand currentCommand];
Modified: trunk/bibdesk/BibDocument.h
===================================================================
--- trunk/bibdesk/BibDocument.h 2011-06-27 16:58:21 UTC (rev 17976)
+++ trunk/bibdesk/BibDocument.h 2011-06-27 19:13:18 UTC (rev 17977)
@@ -349,12 +349,10 @@
- (NSArray *)shownPublications;
- (BDSKGroupsArray *)groups;
-- (void)insertPublications:(NSArray *)pubs atIndexes:(NSIndexSet *)indexes;
-- (void)insertPublication:(BibItem *)pub atIndex:(NSUInteger)index;
+- (void)insertPublications:(NSArray *)pubs atIndexes:(NSIndexSet *)indexes;
- (void)addPublications:(NSArray *)pubArray;
- (void)addPublication:(BibItem *)pub;
-
- (void)removePublicationsAtIndexes:(NSIndexSet *)indexes;
- (void)removePublications:(NSArray *)pubs;
- (void)removePublication:(BibItem *)pub;
Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2011-06-27 16:58:21 UTC (rev 17976)
+++ trunk/bibdesk/BibDocument.m 2011-06-27 19:13:18 UTC (rev 17977)
@@ -804,11 +804,11 @@
[notesSearchIndex resetWithPublications:newPubs];
}
-- (BDSKPublicationsArray *) publications{
+- (BDSKPublicationsArray *)publications{
return publications;
}
-- (NSArray *) shownPublications{
+- (NSArray *)shownPublications{
return shownPublications;
}
@@ -830,16 +830,13 @@
userInfo:notifInfo];
}
-- (void)insertPublication:(BibItem *)pub atIndex:(NSUInteger)idx {
- [self insertPublications:[NSArray arrayWithObject:pub]
atIndexes:[NSIndexSet indexSetWithIndex:idx]];
-}
-
- (void)addPublications:(NSArray *)pubs{
[self insertPublications:pubs atIndexes:[NSIndexSet
indexSetWithIndexesInRange:NSMakeRange(0,[pubs count])]];
}
- (void)addPublication:(BibItem *)pub{
- [self insertPublication:pub atIndex:0]; // insert new pubs at the
beginning, so item number is handled properly
+ // insert new pubs at the beginning, so item number is handled properly
+ [self insertPublications:[NSArray arrayWithObject:pub]
atIndexes:[NSIndexSet indexSetWithIndex:0]];
}
- (void)removePublicationsAtIndexes:(NSIndexSet *)indexes{
@@ -872,8 +869,7 @@
}
- (void)removePublication:(BibItem *)pub{
- NSIndexSet *indexes = [NSIndexSet indexSetWithIndex:[publications
indexOfObjectIdenticalTo:pub]];
- [self removePublicationsAtIndexes:indexes];
+ [self removePublicationsAtIndexes:[NSIndexSet
indexSetWithIndex:[publications indexOfObjectIdenticalTo:pub]]];
}
#pragma mark Groups accessors
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit