Revision: 7001
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7001&view=rev
Author:   hofman
Date:     2010-12-21 14:07:17 +0000 (Tue, 21 Dec 2010)

Log Message:
-----------
Don't bother setting first and last page in print info as they are ignored 
anyway. 

Modified Paths:
--------------
    trunk/SKMainDocument.m

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2010-12-21 13:58:27 UTC (rev 7000)
+++ trunk/SKMainDocument.m      2010-12-21 14:07:17 UTC (rev 7001)
@@ -110,9 +110,6 @@
 #define SKTagsKey                   @"Tags"
 #define SKRatingKey                 @"Rating"
 
-#define SKPDFPrintAutoRotate  @"PDFPrintAutoRotate"
-#define SKPDFPrintScalingMode @"PDFPrintScalingMode"
-
 static char SKMainDocumentDefaultsObservationContext;
 
 
@@ -200,21 +197,13 @@
     [[self mainWindowController] setTags:[tmpData openMetaTags]];
     
     [[self mainWindowController] setRating:[tmpData openMetaRating]];
-    
-    [[[self printInfo] dictionary] setValue:[NSNumber 
numberWithInteger:[[tmpData pdfDocument] pageCount]] forKey:NSPrintLastPage];
 }
 
 - (void)windowControllerDidLoadNib:(NSWindowController *)aController{
     [[self undoManager] disableUndoRegistration];
     
-    NSPrintInfo *printInfo = [[[self printInfo] copy] autorelease];
-    NSMutableDictionary *printDict = [printInfo dictionary];
-    [printDict setValue:[NSNumber numberWithBool:YES] 
forKey:SKPDFPrintAutoRotate];
-    [printDict setValue:[NSNumber numberWithInteger:kPDFPrintPageScaleNone] 
forKey:SKPDFPrintScalingMode];
-    [printDict setValue:[NSNumber numberWithInteger:1] 
forKey:NSPrintFirstPage];
-    [printDict setValue:[NSNumber numberWithInteger:1] forKey:NSPrintLastPage];
-    [printDict setValue:[NSNumber numberWithBool:YES] forKey:NSPrintAllPages];
-    [self setPrintInfo:printInfo];
+    // set a copy, because we change the printInfo, and we don't want to 
change the shared instance
+    [self setPrintInfo:[[[self printInfo] copy] autorelease]];
     
     [self setDataFromTmpData];
     [tmpData release];
@@ -897,11 +886,8 @@
     if (showPrintPanel == NO)
         [infoDict setObject:[NSNumber numberWithBool:YES] 
forKey:SKSuppressPrintPanel];
     
-    BOOL autoRotate = [[infoDict objectForKey:SKPDFPrintAutoRotate] boolValue];
-    PDFPrintScalingMode pageScaling = [[infoDict 
objectForKey:SKPDFPrintScalingMode] integerValue];
+    [[self pdfView] printWithInfo:printInfo autoRotate:YES 
pageScaling:kPDFPrintPageScaleNone];
     
-    [[self pdfView] printWithInfo:printInfo autoRotate:autoRotate 
pageScaling:pageScaling];
-    
     if (delegate && didPrintSelector) {
         printCallback = [[NSInvocation invocationWithTarget:delegate 
selector:didPrintSelector] retain];
         [printCallback setArgument:&self atIndex:2];


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

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to