Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2004-01-07 12:47:02 -0500
committerAlain Magloire2004-01-07 12:47:02 -0500
commitcc705581355a3839ef3d753e6c2925d8b1566e15 (patch)
tree8cf6edc283f9f23dc0a8828062f869a697aa8c36
parentdb074337e7b82f82241300d24b98a2e1e2bb818a (diff)
downloadorg.eclipse.cdt-cc705581355a3839ef3d753e6c2925d8b1566e15.tar.gz
org.eclipse.cdt-cc705581355a3839ef3d753e6c2925d8b1566e15.tar.xz
org.eclipse.cdt-cc705581355a3839ef3d753e6c2925d8b1566e15.zip
Fix bug 49595, the error parser order was not save.
-rw-r--r--core/org.eclipse.cdt.ui/ChangeLog7
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java39
2 files changed, 35 insertions, 11 deletions
diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog
index 4283488f412..d9c5aa16b2a 100644
--- a/core/org.eclipse.cdt.ui/ChangeLog
+++ b/core/org.eclipse.cdt.ui/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-07 Alain Magloire
+
+ Fix for bug 49595
+ The error parser order were not save correctly.
+
+ * src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java
+
2003-12-30 Alain Magloire
* src/org/eclipse/cdt/internal/ui/editor/CEditor.java: Fix in the setSelection().
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java
index 6bbb3c29673..db8fbcc4772 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java
@@ -142,16 +142,8 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
protected void initializeValues() {
initMapParsers();
- List list = new ArrayList(mapParsers.size());
- Iterator items = mapParsers.keySet().iterator();
- while( items.hasNext()) {
- list.add((String)items.next());
- }
- fErrorParserList.setElements(list);
-
- list.clear();
- String[] parserIDs = EMPTY;
+ String[] parserIDs;
IProject project = getContainer().getProject();
if (project == null) {
// From a Preference.
@@ -161,7 +153,24 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
parserIDs = getErrorParserIDs(project);
}
- fErrorParserList.setCheckedElements(Arrays.asList(parserIDs));
+ List checkedList = Arrays.asList(parserIDs);
+ fErrorParserList.setElements(checkedList);
+ fErrorParserList.setCheckedElements(checkedList);
+
+ Iterator items = mapParsers.keySet().iterator();
+ while( items.hasNext()) {
+ String item = (String)items.next();
+ boolean found = false;
+ for (int i = 0; i < parserIDs.length; i++) {
+ if (item.equals(parserIDs[i])) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ fErrorParserList.addElement(item);
+ }
+ }
}
public void createControl(Composite parent) {
@@ -204,7 +213,15 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
monitor = new NullProgressMonitor();
}
monitor.beginTask("Setting Error Parsers...", 1);
- List list = fErrorParserList.getCheckedElements();
+ List elements = fErrorParserList.getElements();
+ int count = elements.size();
+ List list = new ArrayList(count);
+ for (int i = 0; i < count; i++) {
+ Object obj = elements.get(i);
+ if (fErrorParserList.isChecked(obj)) {
+ list.add(obj);
+ }
+ }
String[] parserIDs = (String[])list.toArray(EMPTY);

Back to the top