Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Krasilnikov2007-10-24 05:47:41 -0400
committerOleg Krasilnikov2007-10-24 05:47:41 -0400
commit18fa1c4fc2912b1ba641fe9daa2c739e17d2199d (patch)
treeb01313329a738307f33e259c0d70bc2f2a23670f
parent475c93f89d78e03eb0a65ab0e1f89120dbaedfa0 (diff)
downloadorg.eclipse.cdt-18fa1c4fc2912b1ba641fe9daa2c739e17d2199d.tar.gz
org.eclipse.cdt-18fa1c4fc2912b1ba641fe9daa2c739e17d2199d.tar.xz
org.eclipse.cdt-18fa1c4fc2912b1ba641fe9daa2c739e17d2199d.zip
Bug #205030 : additional patch
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpBook.java22
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpEntry.java3
2 files changed, 22 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpBook.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpBook.java
index 15db59f3289..b7c22218fa8 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpBook.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpBook.java
@@ -20,6 +20,10 @@ public class CHelpBook implements ICHelpBook {
private static final String ATTR_TITLE = "title"; //$NON-NLS-1$
private static final String ATTR_BTYPE = "type"; //$NON-NLS-1$
private static final String NODE_ENTRY = "entry"; //$NON-NLS-1$
+ private static final String TYPE_C = "HELP_TYPE_C"; //$NON-NLS-1$
+ private static final String TYPE_CPP = "HELP_TYPE_CPP"; //$NON-NLS-1$
+ private static final String TYPE_ASM = "HELP_TYPE_ASM"; //$NON-NLS-1$
+ private static final int DEFAULT_VAL = ICHelpBook.HELP_TYPE_C;
private int type;
private String title;
@@ -31,9 +35,22 @@ public class CHelpBook implements ICHelpBook {
if (e.hasAttribute(ATTR_TITLE))
title = e.getAttribute(ATTR_TITLE).trim();
if (e.hasAttribute(ATTR_BTYPE)) {
+ String s = e.getAttribute(ATTR_BTYPE);
try {
- type = Integer.parseInt(e.getAttribute(ATTR_TITLE));
- } catch (NumberFormatException ee) {}
+ type = Integer.parseInt(s);
+ if (type < DEFAULT_VAL ||
+ type > ICHelpBook.HELP_TYPE_ASM)
+ type = DEFAULT_VAL;
+ } catch (NumberFormatException ee) {
+ if (TYPE_C.equalsIgnoreCase(s))
+ type = ICHelpBook.HELP_TYPE_C;
+ else if (TYPE_CPP.equalsIgnoreCase(s))
+ type = ICHelpBook.HELP_TYPE_CPP;
+ else if (TYPE_ASM.equalsIgnoreCase(s))
+ type = ICHelpBook.HELP_TYPE_ASM;
+ else
+ type = DEFAULT_VAL;
+ }
}
NodeList list = e.getChildNodes();
for(int i = 0; i < list.getLength(); i++){
@@ -68,7 +85,6 @@ public class CHelpBook implements ICHelpBook {
IFunctionSummary[] fs = he.getFunctionSummary();
if (fs != null && fs.length > 0)
return fs[0];
- // TODO: function summary selection
}
return null;
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpEntry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpEntry.java
index 5bb8e08a6f2..bd0df39e2ac 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpEntry.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/help/CHelpEntry.java
@@ -36,6 +36,9 @@ public class CHelpEntry {
}
fss = (CFunctionSummary[])obs1.toArray(new CFunctionSummary[obs1.size()]);
hts = (CHelpTopic[])obs2.toArray(new CHelpTopic[obs2.size()]);
+
+ if (fss.length == 0 && hts.length == 0)
+ isValid = false; // nothing to display
}
/**

Back to the top