Revision: 7475
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7475&view=rev
Author:   hofman
Date:     2011-09-08 09:49:00 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
Check for allowsPrinting rather than isEncrypted before converting notes, 
because otherwise it will save an empty document.

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

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2011-09-07 22:51:32 UTC (rev 7474)
+++ trunk/SKMainDocument.m      2011-09-08 09:49:00 UTC (rev 7475)
@@ -1016,7 +1016,8 @@
     } else {
         [[controller window] orderOut:nil];
         
-        if (pdfDocWithoutNotes && [pdfDocWithoutNotes isLocked] && 
[pdfDocWithoutNotes unlockWithPassword:[controller stringValue]] == NO) {
+        if (pdfDocWithoutNotes && [pdfDocWithoutNotes allowsPrinting] == NO && 
+            ([pdfDocWithoutNotes unlockWithPassword:[controller stringValue]] 
== NO || [pdfDocWithoutNotes allowsPrinting] == NO)) {
             SKPasswordSheetController *passwordSheetController = 
[[[SKPasswordSheetController alloc] init] autorelease];
             [passwordSheetController beginSheetModalForWindow:[[self 
mainWindowController] window] modalDelegate:self didEndSelector:_cmd 
contextInfo:pdfDocWithoutNotes];
         } else {
@@ -1034,9 +1035,9 @@
     // remove the sheet, to make place for either the password or progress 
sheet
     [[alert window] orderOut:nil];
     
-    if ([[self pdfDocument] isEncrypted]) {
+    if ([[self pdfDocument] allowsPrinting] == NO) {
         pdfDocWithoutNotes = [[PDFDocument alloc] initWithData:pdfData];
-        if ([self tryToUnlockDocument:pdfDocWithoutNotes] == NO) {
+        if ([self tryToUnlockDocument:pdfDocWithoutNotes] == NO || 
[pdfDocWithoutNotes allowsPrinting] == NO) {
             
             SKPasswordSheetController *passwordSheetController = 
[[[SKPasswordSheetController alloc] init] autorelease];
             

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


------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to