Revision: 2611
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2611&view=rev
Author:   hofman
Date:     2007-08-06 06:23:51 -0700 (Mon, 06 Aug 2007)

Log Message:
-----------
Remove PDF With Embedded Notes from format popup when exporting a PDF that 
cannot be printed, as that is not supported by PDFKit. 

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

Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m  2007-08-06 11:33:26 UTC (rev 2610)
+++ trunk/SKDocument.m  2007-08-06 13:23:51 UTC (rev 2611)
@@ -166,9 +166,13 @@
 - (BOOL)prepareSavePanel:(NSSavePanel *)savePanel {
     NSPopUpButton *formatPopup = popUpButtonSubview([savePanel accessoryView]);
     NSString *lastExportedType = [[NSUserDefaults standardUserDefaults] 
stringForKey:@"SKLastExportedType"];
+    if ([[self pdfDocument] allowsPrinting] == NO) {
+        int index = [formatPopup 
indexOfItemWithRepresentedObject:SKEmbeddedPDFDocumentType];
+        if (index != -1)
+            [formatPopup removeItemAtIndex:index];
+    }
     if (formatPopup && lastExportedType) {
-        NSString *title = [[NSDocumentController sharedDocumentController] 
displayNameForType:lastExportedType];
-        int index = [formatPopup indexOfItemWithTitle:title];
+        int index = [formatPopup 
indexOfItemWithRepresentedObject:lastExportedType];
         if (index != -1 && index != [formatPopup indexOfSelectedItem]) {
             [formatPopup selectItemAtIndex:index];
             [formatPopup sendAction:[formatPopup action] to:[formatPopup 
target]];


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to