Revision: 3604
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3604&view=rev
Author:   hofman
Date:     2008-04-03 05:02:40 -0700 (Thu, 03 Apr 2008)

Log Message:
-----------
Check page index for remote goto action. I guess it may be missing 
(NSNotFound). 

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-04-03 11:36:12 UTC (rev 3603)
+++ trunk/SKPDFView.m   2008-04-03 12:02:40 UTC (rev 3604)
@@ -1432,9 +1432,12 @@
         id document = nil;
         if ([sdc documentClassForType:[sdc typeForContentsOfURL:fileURL 
error:&error]] == [SKDocument class]) {
             if (document = [sdc openDocumentWithContentsOfURL:fileURL 
display:YES error:&error]) {
-                PDFPage *page = [[document pdfDocument] pageAtIndex:[action 
pageIndex]];
-                PDFDestination *dest = [[[PDFDestination alloc] 
initWithPage:page atPoint:[action point]] autorelease];
-                [[document pdfView] goToDestination:dest];
+                unsigned int pageIndex = [action pageIndex];
+                if (pageIndex < [[document pdfDocument] pageCount]) {
+                    PDFPage *page = [[document pdfDocument] 
pageAtIndex:pageIndex];
+                    PDFDestination *dest = [[[PDFDestination alloc] 
initWithPage:page atPoint:[action point]] autorelease];
+                    [[document pdfView] goToDestination:dest];
+                }
             } else if (error) {
                 [NSApp presentError:error];
             }


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

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to