Revision: 6862
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6862&view=rev
Author:   hofman
Date:     2010-10-01 15:18:54 +0000 (Fri, 01 Oct 2010)

Log Message:
-----------
go through all returned nodes from a synctex edit query to find the first one 
with a file

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

Modified: trunk/SKPDFSynchronizerServer.m
===================================================================
--- trunk/SKPDFSynchronizerServer.m     2010-10-01 14:49:57 UTC (rev 6861)
+++ trunk/SKPDFSynchronizerServer.m     2010-10-01 15:18:54 UTC (rev 6862)
@@ -550,11 +550,14 @@
 - (BOOL)synctexFindFileLine:(NSInteger *)linePtr file:(NSString **)filePtr 
forLocation:(NSPoint)point inRect:(NSRect)rect pageBounds:(NSRect)bounds 
atPageIndex:(NSUInteger)pageIndex {
     BOOL rv = NO;
     if (synctex_edit_query(scanner, (int)pageIndex + 1, point.x, 
NSMaxY(bounds) - point.y) > 0) {
-        synctex_node_t node = synctex_next_result(scanner);
-        if (node) {
-            *linePtr = MAX(synctex_node_line(node), 1) - 1;
-            *filePtr = [self 
sourceFileForFileSystemRepresentation:synctex_scanner_get_name(scanner, 
synctex_node_tag(node)) isTeX:YES];
-            rv = *filePtr != nil;
+        synctex_node_t node;
+        const char *file;
+        while (rv == NO && (node = synctex_next_result(scanner))) {
+            if (file = synctex_scanner_get_name(scanner, 
synctex_node_tag(node))) {
+                *linePtr = MAX(synctex_node_line(node), 1) - 1;
+                *filePtr = [self sourceFileForFileSystemRepresentation:file 
isTeX:YES];
+                rv = YES;
+            }
         }
     }
     return rv;


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

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to