Revision: 3673
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3673&view=rev
Author:   hofman
Date:     2008-04-08 03:00:46 -0700 (Tue, 08 Apr 2008)

Log Message:
-----------
Allow missing page entries in pdfsync file, even though I don't think that can 
occur.

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

Modified: trunk/SKPDFSynchronizer.m
===================================================================
--- trunk/SKPDFSynchronizer.m   2008-04-07 21:35:35 UTC (rev 3672)
+++ trunk/SKPDFSynchronizer.m   2008-04-08 10:00:46 UTC (rev 3673)
@@ -338,7 +338,7 @@
     NSMutableArray *files = [NSMutableArray array];
     NSString *pdfsyncString = [NSString stringWithContentsOfFile:theFileName 
encoding:NSUTF8StringEncoding error:NULL];
     NSString *file;
-    int recordIndex, line;
+    int recordIndex, line, pageIndex;
     float x, y;
     NSMutableDictionary *record;
     NSMutableArray *array;
@@ -397,10 +397,12 @@
             }
         } else if (ch == 's') {
             // start of a new page, the scanned integer should always equal 
[pages count]+1
-            [scanner scanInt:NULL];
-            array = [[NSMutableArray alloc] init];
-            [pages addObject:array];
-            [array release];
+            if ([scanner scanInt:&pageIndex] == NO) pageIndex = [pages count] 
+ 1;
+            while (pageIndex > (int)[pages count]) {
+                array = [[NSMutableArray alloc] init];
+                [pages addObject:array];
+                [array release];
+            }
         } else if (ch == '(') {
             // start of a new source file
             if ([scanner scanUpToCharactersFromSet:[NSCharacterSet 
newlineCharacterSet] intoString:&file]) {


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
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to