Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-patch] UI patch - some new ... Changes

> 
> New icons for enumerations, enumerators, and typedefs.
> A small fix for CElementLableProvider.getText()
> 

This was applied with a some changes,  IStructure does not
extend IVariableDeclaration, unless it was your intention.  Changed code below
The else if () case test instanceof IVariableDeclaration.



================================================================================
Index: src/org/eclipse/cdt/ui/CElementLabelProvider.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java,v
retrieving revision 1.7
diff -u -r1.7 CElementLabelProvider.java
--- src/org/eclipse/cdt/ui/CElementLabelProvider.java	1 Apr 2003 18:41:00 -0000	1.7
+++ src/org/eclipse/cdt/ui/CElementLabelProvider.java	1 Apr 2003 19:11:13 -0000
@@ -58,7 +58,7 @@
 		if (element instanceof ICElement) {
 			ICElement celem= (ICElement)element;
 			
-			String name;
+			String name = "";
 			switch(celem.getElementType()){
 				case ICElement.C_FIELD:
 				case ICElement.C_VARIABLE:
@@ -79,7 +79,7 @@
 				case ICElement.C_ENUMERATION:
 					if((celem.getElementName() != null) && (celem.getElementName().length() > 0)){
 						name = celem.getElementName();
-					} else {
+					} else if (celem instanceof IVariableDeclaration) {
 						IVariableDeclaration varDecl = (IVariableDeclaration) celem;
 						name = varDecl.getTypeName();				
 					}



Back to the top