From 28b8e38cb1383541e1e4c575a7b9d6b87528aa88 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Mon, 23 Oct 2006 10:55:33 +0000 Subject: [PATCH] Patch by ashish for Bug 161529 - Open Include from the Outline view does not automatically resolve the include file --- .../eclipse/cdt/internal/ui/editor/OpenIncludeAction.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java index b52055c194a..72d8adfc0b6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java @@ -207,7 +207,11 @@ public class OpenIncludeAction extends Action { public boolean visit(IResourceProxy proxy) throws CoreException { if (proxy.getType() == IResource.FILE && proxy.getName().equalsIgnoreCase(name.lastSegment())) { - list.add(proxy.requestResource().getLocation()); + IPath rPath = proxy.requestResource().getLocation(); + int numSegToRemove = rPath.segmentCount() - name.segmentCount(); + IPath sPath = rPath.removeFirstSegments(numSegToRemove); + if (sPath.equals(name)) + list.add(rPath); return false; } return true;