1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Workaround missing timestamps in includes

This commit is contained in:
Markus Schorn 2006-07-04 11:56:28 +00:00
parent 7aecc5731f
commit 9cb27b5066

View file

@ -670,11 +670,15 @@ public class IBViewPart extends ViewPart
if (node != null) {
IWorkbenchPage page= getSite().getPage();
IBFile ibf= node.getDirectiveFile();
long timestamp= node.getTimestamp();
if (ibf != null) {
IEditorPart editor= null;
IPath filebufferKey= null;
IFile f= ibf.getResource();
if (f != null) {
if (timestamp == 0) {
timestamp= f.getLocalTimeStamp();
}
fLastNavigationNode= node;
try {
editor= IDE.openEditor(page, f, false);
@ -686,6 +690,9 @@ public class IBViewPart extends ViewPart
else {
IPath location= ibf.getLocation();
if (location != null) {
if (timestamp == 0) {
timestamp= location.toFile().lastModified();
}
fLastNavigationNode= node;
ExternalEditorInput ei= new ExternalEditorInput(new FileStorage(null, location));
try {
@ -702,7 +709,7 @@ public class IBViewPart extends ViewPart
Position pos= new Position(node.getDirectiveCharacterOffset(),
node.getDirectiveName().length() + 2);
if (filebufferKey != null) {
IPositionConverter pc= CCorePlugin.getPositionTrackerManager().findPositionConverter(filebufferKey, node.getTimestamp());
IPositionConverter pc= CCorePlugin.getPositionTrackerManager().findPositionConverter(filebufferKey, timestamp);
if (pc != null) {
pos= pc.historicToActual(pos);
}