1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 11:25:35 +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() * @see org.eclipse.cdt.core.model.IIncludeEntry#getFullIncludePath()
*/ */
public IPath getFullIncludePath() { public IPath getFullIncludePath() {
IPath p; final IPath inc = getIncludePath();
IPath inc = getIncludePath();
if (!basePath.isEmpty()) { if (!basePath.isEmpty()) {
IPath loc = basePath; IPath loc = basePath;
if (!loc.isAbsolute()) { if (!loc.isAbsolute()) {
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(loc.append(inc)); IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(loc.append(inc));
if (res != null) { if (res != null) {
return res.getLocation(); IPath location = res.getLocation();
if (location != null) {
return location;
}
} }
} }
p = loc.append(inc); return loc.append(inc);
return p;
} }
p = inc; if (!inc.isAbsolute()) {
if (!p.isAbsolute()) {
IPath resPath = getPath(); IPath resPath = getPath();
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath); IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath.append(inc));
if (res != null) { if (res != null) {
if (res.getType() == IResource.FILE) {
res = res.getParent();
}
IPath location = res.getLocation(); IPath location = res.getLocation();
if (location != null) { if (location != null) {
p = location.append(p); return location;
} }
} }
} }
return p; return inc;
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

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