Revision: 3324
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3324&view=rev
Author:   hofman
Date:     2007-12-08 11:24:51 -0800 (Sat, 08 Dec 2007)

Log Message:
-----------
Load PDFDocument from URL when available rather than from the data. This 
resolves relative URLs (which otherwise lead to a crash due to a PDFKit bug). 

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

Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m  2007-12-08 17:58:16 UTC (rev 3323)
+++ trunk/SKDocument.m  2007-12-08 19:24:51 UTC (rev 3324)
@@ -600,7 +600,7 @@
     
     if ([docType isEqualToString:SKPDFDocumentType] || [docType 
isEqualToString:SKPDFDocumentType]) {
         if ((data = [[NSData alloc] initWithContentsOfURL:absoluteURL 
options:NSUncachedRead error:&error]) &&
-            (pdfDoc = [[PDFDocument alloc] initWithData:data])) {
+            (pdfDoc = [[PDFDocument alloc] initWithURL:absoluteURL])) {
             if ([self readNotesFromExtendedAttributesAtURL:absoluteURL 
error:&error] == NO) {
                 NSAlert *alert = [NSAlert 
alertWithMessageText:NSLocalizedString(@"Unable to Read Notes", @"Message in 
alert dialog") 
                                                  
defaultButton:NSLocalizedString(@"No", @"Button title")
@@ -641,7 +641,7 @@
         if (pdfFile) {
             NSURL *pdfURL = [NSURL fileURLWithPath:[path 
stringByAppendingPathComponent:pdfFile]];
             if ((data = [[NSData alloc] initWithContentsOfURL:pdfURL 
options:NSUncachedRead error:&error]) &&
-                (pdfDoc = [[PDFDocument alloc] initWithData:data])) {
+                (pdfDoc = [[PDFDocument alloc] initWithURL:pdfURL])) {
                 NSString *skimFile = [[NSFileManager defaultManager] 
subfileWithExtension:@"skim" inPDFBundleAtPath:path];
                 if (skimFile) {
                     NSArray *array = [NSKeyedUnarchiver 
unarchiveObjectWithFile:[path stringByAppendingPathComponent:skimFile]];


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

-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to