Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Fix to PR 36582

Fix to PR 36582:

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.90
diff -u -r1.90 ChangeLog
--- ChangeLog	14 Apr 2003 17:31:36 -0000	1.90
+++ ChangeLog	16 Apr 2003 18:42:18 -0000
@@ -1,3 +1,11 @@
+2003-04-16 Alain Magloire
+
+	Bug 36582
+	
+	* src/org/eclipse.cdt.internal/ui/cview/CView.java
+	linkToEditor() check is we have a valid ITranslationUnit.
+	The isOpenEditor() has a nasty side effect of calling "objdump"
+
 2003-04-14 Alain Magloire
 
 	The problem: the old parser can still hangs and bring chaos, this
Index: src/org/eclipse/cdt/internal/ui/cview/CView.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java,v
retrieving revision 1.21
diff -u -r1.21 CView.java
--- src/org/eclipse/cdt/internal/ui/cview/CView.java	5 Apr 2003 19:50:43 -0000	1.21
+++ src/org/eclipse/cdt/internal/ui/cview/CView.java	16 Apr 2003 18:42:19 -0000
@@ -19,6 +19,7 @@
 import org.eclipse.cdt.core.model.ICProject;
 import org.eclipse.cdt.core.model.IParent;
 import org.eclipse.cdt.core.model.ISourceReference;
+import org.eclipse.cdt.core.model.ITranslationUnit;
 import org.eclipse.cdt.core.resources.MakeUtil;
 import org.eclipse.cdt.internal.ui.StandardCElementLabelProvider;
 import org.eclipse.cdt.internal.ui.editor.OpenIncludeAction;
@@ -1127,12 +1128,18 @@
 		Object obj= selection.getFirstElement();
 
 		if (selection.size() == 1) {
-			IEditorPart part= EditorUtility.isOpenInEditor(obj);
-			if (part != null) {
-				IWorkbenchPage page= getSite().getPage();
-				page.bringToTop(part);
-				if (obj instanceof ICElement) 
-					EditorUtility.revealInEditor(part, (ICElement) obj);
+			if (obj instanceof ISourceReference) {
+				ITranslationUnit tu = ((ISourceReference)obj).getTranslationUnit();
+				if (tu != null) {
+					IEditorPart part= EditorUtility.isOpenInEditor(obj);
+					if (part != null) {
+						IWorkbenchPage page= getSite().getPage();
+						page.bringToTop(part);
+						if (obj instanceof ICElement) {
+							EditorUtility.revealInEditor(part, (ICElement) obj);
+						}
+					}
+				}
 			}
 		}
 		



Back to the top