Revision: 4380
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4380&view=rev
Author:   hofman
Date:     2008-08-11 21:30:01 +0000 (Mon, 11 Aug 2008)

Log Message:
-----------
Create collections used by pdfsync and synctex support lazily

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

Modified: trunk/SKPDFSynchronizer.m
===================================================================
--- trunk/SKPDFSynchronizer.m   2008-08-11 21:08:44 UTC (rev 4379)
+++ trunk/SKPDFSynchronizer.m   2008-08-11 21:30:01 UTC (rev 4380)
@@ -98,10 +98,10 @@
         lastModDate = nil;
         isPdfsync = YES;
         
-        pages = [[NSMutableArray alloc] init];
-        lines = (NSMutableDictionary 
*)CFDictionaryCreateMutable(kCFAllocatorDefault, 0, 
&kSKCaseInsensitiveStringDictionaryKeyCallBacks, 
&kCFTypeDictionaryValueCallBacks);
+        pages = nil;
+        lines = nil;
         
-        filenames = (NSMutableDictionary 
*)CFDictionaryCreateMutable(kCFAllocatorDefault, 0, 
&kSKCaseInsensitiveStringDictionaryKeyCallBacks, 
&kCFTypeDictionaryValueCallBacks);
+        filenames = nil;
         scanner = NULL;
         
         NSPort *port1 = [NSPort port];
@@ -336,8 +336,14 @@
 
 - (BOOL)parsePdfsyncFile:(NSString *)theFileName {
 
-    [pages removeAllObjects];
-    [lines removeAllObjects];
+    if (pages)
+        [pages removeAllObjects];
+    else
+        pages = [[NSMutableArray alloc] init];
+    if (lines)
+        [lines removeAllObjects];
+    else
+        lines = (NSMutableDictionary 
*)CFDictionaryCreateMutable(kCFAllocatorDefault, 0, 
&kSKCaseInsensitiveStringDictionaryKeyCallBacks, 
&kCFTypeDictionaryValueCallBacks);
     
     [self setSyncFileName:theFileName];
     isPdfsync = YES;
@@ -565,7 +571,10 @@
         synctex_scanner_free(scanner);
     if (scanner = synctex_scanner_new_with_output_file([theFileName 
fileSystemRepresentation])) {
         [self 
setSyncFileName:SKPathFromFileSystemRepresentation(synctex_scanner_get_synctex(scanner))];
-        [filenames removeAllObjects];
+        if (filenames)
+            [filenames removeAllObjects];
+        else
+            filenames = (NSMutableDictionary 
*)CFDictionaryCreateMutable(kCFAllocatorDefault, 0, 
&kSKCaseInsensitiveStringDictionaryKeyCallBacks, 
&kCFTypeDictionaryValueCallBacks);
         NSString *basePath = [[self fileName] 
stringByDeletingLastPathComponent];
         NSString *file, *filename;
         synctex_node_t node = synctex_scanner_input(scanner);


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 Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to