From 5f480cb5e8d562cd44d5d87472d0100b8842ba5e Mon Sep 17 00:00:00 2001 From: jlin16 Date: Wed, 11 Oct 2006 06:57:08 +0000 Subject: [PATCH] Ensure the validity of Ffs Sections when adding a new Sections to Ffs. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1721 6f19259b-4bc3-4df7-8a09-765794883524 --- .../platform/ui/FpdBuildOptions.java | 5 ++++ .../platform/ui/FpdFileContents.java | 24 +++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java index 03a4ed5f98..dae2aed050 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java @@ -625,6 +625,10 @@ public class FpdBuildOptions extends IInternalFrame { docConsole.setSaved(false); ffc.removeBuildOptionsFfs(jTableFfs.getSelectedRow()); ffsTableModel.removeRow(jTableFfs.getSelectedRow()); + sectionTableModel.setRowCount(0); + sectionsTableModel.setRowCount(0); + subsectionsTableModel.setRowCount(0); + ffsAttributesTableModel.setRowCount(0); } }); } @@ -1164,6 +1168,7 @@ public class FpdBuildOptions extends IInternalFrame { sectionsTableModel.removeRow(jTableFfsSections.getSelectedRow()); ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow()); + subsectionsTableModel.setRowCount(0); } }); } diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java index 1acb42e991..5f4e0b522e 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java @@ -115,8 +115,8 @@ public class FpdFileContents { if (moduleSa.getPcdBuildDefinition() == null || moduleSa.getPcdBuildDefinition().getPcdDataList() == null) { continue; } - String ModuleInfo = moduleSa.getModuleGuid() + " " + moduleSa.getModuleVersion() + - " " + moduleSa.getPackageGuid() + " " + moduleSa.getPackageVersion() + " " + listToString(moduleSa.getSupArchList()); + String ModuleInfo = moduleSa.getModuleGuid().toLowerCase() + " " + moduleSa.getModuleVersion() + + " " + moduleSa.getPackageGuid().toLowerCase() + " " + moduleSa.getPackageVersion() + " " + listToString(moduleSa.getSupArchList()); List lp = moduleSa.getPcdBuildDefinition().getPcdDataList(); ListIterator lpi = lp.listIterator(); while (lpi.hasNext()) { @@ -374,8 +374,10 @@ public class FpdFileContents { cursor.pop(); cursor.removeXml(); if (getFrameworkModulesCount() == 0) { - cursor.toParent(); - cursor.removeXml(); + cursor.dispose(); + removeElement(getfpdFrameworkModules()); + fpdFrameworkModules = null; + return; } } cursor.dispose(); @@ -478,7 +480,7 @@ public class FpdFileContents { String[] s = moduleInfo.split(" "); for(int i = 0; i < al.size(); ++i){ String consumer = al.get(i); - if (consumer.contains(s[0]) && consumer.contains(s[2])){ + if (consumer.contains(s[0].toLowerCase()) && consumer.contains(s[2].toLowerCase())){ String[] consumerPart = consumer.split(" "); if (!consumerPart[4].equals(s[4])) { continue; @@ -2372,7 +2374,9 @@ public class FpdFileContents { if (sections == null){ sections = ffs.addNewSections(); } - sections.addNewSections().setEncapsulationType(encapType); + BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2 sections2 = sections.addNewSections(); + sections2.setEncapsulationType(encapType); + sections2.addNewSection().setSectionType(EfiSectionType.Enum.forString("EFI_SECTION_PE32")); } public void removeBuildOptionsFfsSectionsSections(int i, int j) { @@ -2498,9 +2502,9 @@ public class FpdFileContents { ListIterator li = sections2.getSectionList().listIterator(); while(li.hasNext()) { BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section section = li.next(); - if (section.isSetSectionType()) { - al.add(section.getSectionType().toString()); - } +// if (section.isSetSectionType()) { + al.add(section.getSectionType()+""); +// } } } @@ -2549,7 +2553,7 @@ public class FpdFileContents { if (ffs.getSections().getSectionList() != null){ ListIterator li = ffs.getSections().getSectionList().listIterator(); while (li.hasNext()) { - firstLevelSection.add(li.next().getSectionType().toString()); + firstLevelSection.add(li.next().getSectionType()+""); } } if (ffs.getSections().getSectionsList() != null) { -- 2.39.2