Revision: 3632
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3632&view=rev
Author:   hofman
Date:     2008-04-05 05:22:32 -0700 (Sat, 05 Apr 2008)

Log Message:
-----------
Check for embedded/bare PDF types before checking PDF, because those conform to 
the PDF UTI.

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

Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m  2008-04-05 12:10:40 UTC (rev 3631)
+++ trunk/SKDocument.m  2008-04-05 12:22:32 UTC (rev 3632)
@@ -382,8 +382,15 @@
     [[NSNotificationCenter defaultCenter] 
postNotificationName:SKDocumentWillSaveNotification object:self];
     BOOL didWrite = NO;
     NSError *error = nil;
-    if (SKIsPDFDocumentType(typeName)) {
+    if (SKIsEmbeddedPDFDocumentType(typeName)) {
+        // this must be checked before PDF, as we check for comformance to the 
UTI
+        [[self mainWindowController] removeTemporaryAnnotations];
+        didWrite = [[self pdfDocument] writeToURL:absoluteURL];
+    } else if (SKIsBarePDFDocumentType(typeName)) {
+        // this must be checked before PDF, as we check for comformance to the 
UTI
         didWrite = [pdfData writeToURL:absoluteURL options:0 error:&error];
+    } else if (SKIsPDFDocumentType(typeName)) {
+        didWrite = [pdfData writeToURL:absoluteURL options:0 error:&error];
         // notes are only saved as a dry-run to test if we can write, they are 
not copied to the final destination. 
         // if we automatically save a .skim backup we silently ignore this 
problem
         if (didWrite && NO == [[NSUserDefaults standardUserDefaults] 
boolForKey:SKAutoSaveSkimNotesKey])
@@ -411,11 +418,6 @@
         }
         didWrite = [fileWrapper writeToFile:[absoluteURL path] atomically:NO 
updateFilenames:NO];
         [fileWrapper release];
-    } else if (SKIsEmbeddedPDFDocumentType(typeName)) {
-        [[self mainWindowController] removeTemporaryAnnotations];
-        didWrite = [[self pdfDocument] writeToURL:absoluteURL];
-    } else if (SKIsBarePDFDocumentType(typeName)) {
-        didWrite = [pdfData writeToURL:absoluteURL options:0 error:&error];
     } else if (SKIsNotesDocumentType(typeName)) {
         NSData *data = [self notesData];
         if (data)


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 the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to