Revision: 28326
          http://sourceforge.net/p/bibdesk/svn/28326
Author:   hofman
Date:     2023-07-18 14:25:44 +0000 (Tue, 18 Jul 2023)
Log Message:
-----------
remove an intermediate conveniene method and print selection through common 
method

Modified Paths:
--------------
    trunk/bibdesk/BibDocument.h
    trunk/bibdesk/BibDocument.m
    trunk/bibdesk/BibDocument_Actions.m
    trunk/bibdesk/BibDocument_DataSource.m

Modified: trunk/bibdesk/BibDocument.h
===================================================================
--- trunk/bibdesk/BibDocument.h 2023-07-17 15:04:27 UTC (rev 28325)
+++ trunk/bibdesk/BibDocument.h 2023-07-18 14:25:44 UTC (rev 28326)
@@ -349,7 +349,6 @@
 - (void)reportTemporaryCiteKeysForNewDocument:(BOOL)isNewFile;
 - (void)markAsImported;
 
-- (NSString *)bibTeXStringForPublications:(NSArray *)items;
 - (NSString *)bibTeXStringDroppingInternal:(BOOL)drop forPublications:(NSArray 
*)items;
 - (NSString *)previewBibTeXStringForPublications:(NSArray *)items;
 

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2023-07-17 15:04:27 UTC (rev 28325)
+++ trunk/bibdesk/BibDocument.m 2023-07-18 14:25:44 UTC (rev 28326)
@@ -2027,10 +2027,6 @@
 #pragma mark -
 #pragma mark String representations
 
-- (NSString *)bibTeXStringForPublications:(NSArray *)items{
-       return [self bibTeXStringDroppingInternal:NO forPublications:items];
-}
-
 - (NSString *)bibTeXStringDroppingInternal:(BOOL)drop forPublications:(NSArray 
*)items{
     NSMutableString *s = [NSMutableString string];
        BDSKBibTeXOption options = 0;
@@ -2583,7 +2579,7 @@
 #pragma mark Printing support
 
 - (NSPrintOperation *)printOperationWithSettings:(NSDictionary *)printSettings 
error:(NSError **)outError {
-    NSString *string = [self bibTeXStringForPublications:[self publications]];
+    NSString *string = [self bibTeXStringDroppingInternal:NO 
forPublications:[self publications]];
     NSAttributedString *attrString = [[[NSAttributedString alloc] 
initWithString:string attributeName:NSFontAttributeName attributeValue:[NSFont 
userFontOfSize:0.0]] autorelease];
     return [NSPrintOperation printOperationWithAttributedString:attrString 
printInfo:[self printInfo] settings:printSettings];
 }

Modified: trunk/bibdesk/BibDocument_Actions.m
===================================================================
--- trunk/bibdesk/BibDocument_Actions.m 2023-07-17 15:04:27 UTC (rev 28325)
+++ trunk/bibdesk/BibDocument_Actions.m 2023-07-18 14:25:44 UTC (rev 28326)
@@ -742,7 +742,7 @@
 }
 
 - (void)printPublications:(NSArray *)pubs {
-    NSString *string = [self bibTeXStringForPublications:pubs];
+    NSString *string = [self bibTeXStringDroppingInternal:NO 
forPublications:pubs];
     NSAttributedString *attrString = [[[NSAttributedString alloc] 
initWithString:string attributeName:NSFontAttributeName attributeValue:[NSFont 
userFontOfSize:0.0]] autorelease];
     NSPrintOperation *printOp = [NSPrintOperation 
printOperationWithAttributedString:attrString printInfo:[self printInfo] 
settings:nil];
     [printOp runOperationModalForWindow:documentWindow delegate:nil 
didRunSelector:NULL contextInfo:NULL];
@@ -750,10 +750,7 @@
 
 - (IBAction)printSelection:(id)sender {
     NSArray *pubs = [self numberOfSelectedPubs] == 0 ? groupedPublications : 
[self selectedPublications];
-    NSString *string = [self bibTeXStringForPublications:pubs];
-    NSAttributedString *attrString = [[[NSAttributedString alloc] 
initWithString:string attributeName:NSFontAttributeName attributeValue:[NSFont 
userFontOfSize:0.0]] autorelease];
-    NSPrintOperation *printOp = [NSPrintOperation 
printOperationWithAttributedString:attrString printInfo:[self printInfo] 
settings:nil];
-    [printOp runOperationModalForWindow:documentWindow delegate:nil 
didRunSelector:NULL contextInfo:NULL];
+    [self printPublications:pubs];
 }
 
 - (IBAction)changeFlag:(id)sender {

Modified: trunk/bibdesk/BibDocument_DataSource.m
===================================================================
--- trunk/bibdesk/BibDocument_DataSource.m      2023-07-17 15:04:27 UTC (rev 
28325)
+++ trunk/bibdesk/BibDocument_DataSource.m      2023-07-18 14:25:44 UTC (rev 
28326)
@@ -440,7 +440,7 @@
        
        switch(dragCopyType){
                case BDSKDragCopyBibTeX:
-                       text = [self bibTeXStringForPublications:pubs];
+            text = [self bibTeXStringDroppingInternal:NO forPublications:pubs];
                        break;
                case BDSKDragCopyCite:
                        text = [self citeStringForPublications:pubs 
citeString:citeString];

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