Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Open editors using a proper ID

This addresses PR 51969, but could also be a problem not just
for the OpenInclude, but OpenDeclarations and the newly contributed
OpenType as well.  

The problem, in a nutshell is that we were asking the workspace to
open editors with a null ID which is an undefined behaviour and in
some cases would not allow additional actions to work properly (ie
the Outline for one).

For the ChangeLog

- Ask the workbench for the appropriate editor ID to use when opening
  up files rather than passing a NULL value which has undefined behaviour.
  Fix for PR 51969

--- PATCH START ---
Index: src/org/eclipse/cdt/internal/ui/util/EditorUtility.java
===================================================================
RCS 
file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/Edi
torUtility.java,v
retrieving revision 1.10
diff -u -r1.10 EditorUtility.java
--- src/org/eclipse/cdt/internal/ui/util/EditorUtility.java	28 Jun 2003 
19:48:06 -0000	1.10
+++ src/org/eclipse/cdt/internal/ui/util/EditorUtility.java	15 Feb 2004 
09:22:58 -0000
@@ -109,7 +109,7 @@
 		if (file != null) {
 			IWorkbenchPage p= CUIPlugin.getActivePage();
 			if (p != null) {
-				IEditorPart editorPart= p.openEditor(file, 
null, activate);
+				IEditorPart editorPart= p.openEditor(file, 
getEditorID(file.getName()), activate);
 				initializeHighlightRange(editorPart);
 				return editorPart;
 			}
--- PATCH END ---
Index: src/org/eclipse/cdt/internal/ui/util/EditorUtility.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java,v
retrieving revision 1.10
diff -u -r1.10 EditorUtility.java
--- src/org/eclipse/cdt/internal/ui/util/EditorUtility.java	28 Jun 2003 19:48:06 -0000	1.10
+++ src/org/eclipse/cdt/internal/ui/util/EditorUtility.java	15 Feb 2004 09:22:58 -0000
@@ -109,7 +109,7 @@
 		if (file != null) {
 			IWorkbenchPage p= CUIPlugin.getActivePage();
 			if (p != null) {
-				IEditorPart editorPart= p.openEditor(file, null, activate);
+				IEditorPart editorPart= p.openEditor(file, getEditorID(file.getName()), activate);
 				initializeHighlightRange(editorPart);
 				return editorPart;
 			}

Back to the top