Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2004-05-27 10:39:27 -0400
committerAlain Magloire2004-05-27 10:39:27 -0400
commite44330ce843f7bcd249217ab0ac39c8cb61372c4 (patch)
treea33b7a8f68b3fed60923ffd0c5ac006391def07a
parent979436cdf1bf91dd0a2f9c022bce8b62e8847572 (diff)
downloadorg.eclipse.cdt-e44330ce843f7bcd249217ab0ac39c8cb61372c4.tar.gz
org.eclipse.cdt-e44330ce843f7bcd249217ab0ac39c8cb61372c4.tar.xz
org.eclipse.cdt-e44330ce843f7bcd249217ab0ac39c8cb61372c4.zip
Fix from Chris Wiebe
-rw-r--r--core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/internal/ui/browser/opentype/OpenTypeAction.java20
1 files changed, 7 insertions, 13 deletions
diff --git a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/internal/ui/browser/opentype/OpenTypeAction.java b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/internal/ui/browser/opentype/OpenTypeAction.java
index 2e41338018..ae72e4d8d5 100644
--- a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/internal/ui/browser/opentype/OpenTypeAction.java
+++ b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/internal/ui/browser/opentype/OpenTypeAction.java
@@ -19,7 +19,6 @@ import org.eclipse.cdt.core.browser.TypeSearchScope;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.resources.FileStorage;
-import org.eclipse.cdt.internal.ui.editor.CEditor;
import org.eclipse.cdt.internal.ui.util.EditorUtility;
import org.eclipse.cdt.internal.ui.util.ExceptionHandler;
import org.eclipse.cdt.ui.CUIPlugin;
@@ -161,8 +160,13 @@ public class OpenTypeAction implements IWorkbenchWindowActionDelegate {
editorPart = EditorUtility.openInEditor(storage);
}
}
- if (editorPart == null)
- return false;
+
+ // highlight the type in the editor
+ if (editorPart != null && editorPart instanceof ITextEditor) {
+ ITextEditor editor = (ITextEditor) editorPart;
+ editor.selectAndReveal(location.getOffset(), location.getLength());
+ return true;
+ }
} catch (CModelException ex) {
ex.printStackTrace();
return false;
@@ -171,16 +175,6 @@ public class OpenTypeAction implements IWorkbenchWindowActionDelegate {
return false;
}
- // highlight the type in the editor
- if (cElement != null && editorPart instanceof CEditor) {
- CEditor editor = (CEditor) editorPart;
- editor.setSelection(cElement);
- return true;
- } else if (editorPart instanceof ITextEditor) {
- ITextEditor editor = (ITextEditor) editorPart;
- editor.selectAndReveal(location.getOffset(), location.getLength());
- return true;
- }
return false;
}

Back to the top