1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 14:15:23 +02:00

Fix for 191251 by Gerhard Schaber, relative paths to linked folders in includes.

This commit is contained in:
Markus Schorn 2007-06-13 15:43:59 +00:00
parent 390ad0f69b
commit 7e9519c643
2 changed files with 21 additions and 29 deletions

View file

@ -85,36 +85,32 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry {
* @see org.eclipse.cdt.core.model.IIncludeEntry#getFullIncludePath()
*/
public IPath getFullIncludePath() {
IPath p;
IPath inc = getIncludePath();
final IPath inc = getIncludePath();
if (!basePath.isEmpty()) {
IPath loc = basePath;
if (!loc.isAbsolute()) {
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(loc.append(inc));
if (res != null) {
return res.getLocation();
IPath location = res.getLocation();
if (location != null) {
return location;
}
}
}
p = loc.append(inc);
return p;
return loc.append(inc);
}
p = inc;
if (!p.isAbsolute()) {
if (!inc.isAbsolute()) {
IPath resPath = getPath();
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath);
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath.append(inc));
if (res != null) {
if (res.getType() == IResource.FILE) {
res = res.getParent();
}
IPath location = res.getLocation();
if (location != null) {
p = location.append(p);
return location;
}
}
}
return p;
return inc;
}
/* (non-Javadoc)

View file

@ -73,36 +73,32 @@ public class IncludeFileEntry extends APathEntry implements IIncludeFileEntry {
* @see org.eclipse.cdt.core.model.IIncludeEntry#getFullIncludePath()
*/
public IPath getFullIncludeFilePath() {
IPath p;
IPath inc = getIncludeFilePath();
final IPath inc = getIncludeFilePath();
if (!basePath.isEmpty()) {
IPath loc = basePath;
if (!loc.isAbsolute()) {
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(loc);
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(loc.append(inc));
if (res != null) {
loc = res.getLocation();
IPath location = res.getLocation();
if (location != null) {
return location;
}
}
}
p = loc.append(inc);
return p;
return loc.append(inc);
}
p = inc;
if (!p.isAbsolute()) {
if (!inc.isAbsolute()) {
IPath resPath = getPath();
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath);
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath.append(inc));
if (res != null) {
if (res.getType() == IResource.FILE) {
res = res.getParent();
}
IPath location = res.getLocation();
if (location != null) {
p = location.append(p);
return location;
}
}
}
return p;
return inc;
}
/* (non-Javadoc)