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:
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()
|
* @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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue