Skip to content

Commit f909a28

Browse files
authored
Merge pull request #39 from nittka/linkExistingFile
link existing rather than first file
2 parents bae6aff + 09dd736 commit f909a28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

org.eclipse.ui.views.pdf/src/org/eclipse/ui/views/pdf/PdfViewPage.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,10 @@ private void addRawObjectToPdfAnnotationList(Integer page, FormObject formObject
491491
}else{
492492
URL url = new URL("file", null, path); //$NON-NLS-1$
493493
IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(URIUtil.toURI(url));
494-
if(files.length>0){
495-
targetFile=files[0];
494+
for (IFile iFile : files) {
495+
if(iFile.exists()) {
496+
targetFile=iFile;
497+
}
496498
}
497499
fileCache.put(path, targetFile);
498500
}

0 commit comments

Comments
 (0)