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:
parent
390ad0f69b
commit
7e9519c643
2 changed files with 21 additions and 29 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue