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
This commit is contained in:
jlin16 2006-10-11 06:57:08 +00:00
parent 91a1f0d7ac
commit 5f480cb5e8
2 changed files with 19 additions and 10 deletions

View File

@ -625,6 +625,10 @@ public class FpdBuildOptions extends IInternalFrame {
docConsole.setSaved(false); docConsole.setSaved(false);
ffc.removeBuildOptionsFfs(jTableFfs.getSelectedRow()); ffc.removeBuildOptionsFfs(jTableFfs.getSelectedRow());
ffsTableModel.removeRow(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()); sectionsTableModel.removeRow(jTableFfsSections.getSelectedRow());
ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(),
jTableFfsSections.getSelectedRow()); jTableFfsSections.getSelectedRow());
subsectionsTableModel.setRowCount(0);
} }
}); });
} }

View File

@ -115,8 +115,8 @@ public class FpdFileContents {
if (moduleSa.getPcdBuildDefinition() == null || moduleSa.getPcdBuildDefinition().getPcdDataList() == null) { if (moduleSa.getPcdBuildDefinition() == null || moduleSa.getPcdBuildDefinition().getPcdDataList() == null) {
continue; continue;
} }
String ModuleInfo = moduleSa.getModuleGuid() + " " + moduleSa.getModuleVersion() + String ModuleInfo = moduleSa.getModuleGuid().toLowerCase() + " " + moduleSa.getModuleVersion() +
" " + moduleSa.getPackageGuid() + " " + moduleSa.getPackageVersion() + " " + listToString(moduleSa.getSupArchList()); " " + moduleSa.getPackageGuid().toLowerCase() + " " + moduleSa.getPackageVersion() + " " + listToString(moduleSa.getSupArchList());
List<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lp = moduleSa.getPcdBuildDefinition().getPcdDataList(); List<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lp = moduleSa.getPcdBuildDefinition().getPcdDataList();
ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lpi = lp.listIterator(); ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lpi = lp.listIterator();
while (lpi.hasNext()) { while (lpi.hasNext()) {
@ -374,8 +374,10 @@ public class FpdFileContents {
cursor.pop(); cursor.pop();
cursor.removeXml(); cursor.removeXml();
if (getFrameworkModulesCount() == 0) { if (getFrameworkModulesCount() == 0) {
cursor.toParent(); cursor.dispose();
cursor.removeXml(); removeElement(getfpdFrameworkModules());
fpdFrameworkModules = null;
return;
} }
} }
cursor.dispose(); cursor.dispose();
@ -478,7 +480,7 @@ public class FpdFileContents {
String[] s = moduleInfo.split(" "); String[] s = moduleInfo.split(" ");
for(int i = 0; i < al.size(); ++i){ for(int i = 0; i < al.size(); ++i){
String consumer = al.get(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(" "); String[] consumerPart = consumer.split(" ");
if (!consumerPart[4].equals(s[4])) { if (!consumerPart[4].equals(s[4])) {
continue; continue;
@ -2372,7 +2374,9 @@ public class FpdFileContents {
if (sections == null){ if (sections == null){
sections = ffs.addNewSections(); 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) { public void removeBuildOptionsFfsSectionsSections(int i, int j) {
@ -2498,9 +2502,9 @@ public class FpdFileContents {
ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section> li = sections2.getSectionList().listIterator(); ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section> li = sections2.getSectionList().listIterator();
while(li.hasNext()) { while(li.hasNext()) {
BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section section = li.next(); BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section section = li.next();
if (section.isSetSectionType()) { // if (section.isSetSectionType()) {
al.add(section.getSectionType().toString()); al.add(section.getSectionType()+"");
} // }
} }
} }
@ -2549,7 +2553,7 @@ public class FpdFileContents {
if (ffs.getSections().getSectionList() != null){ if (ffs.getSections().getSectionList() != null){
ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Section> li = ffs.getSections().getSectionList().listIterator(); ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Section> li = ffs.getSections().getSectionList().listIterator();
while (li.hasNext()) { while (li.hasNext()) {
firstLevelSection.add(li.next().getSectionType().toString()); firstLevelSection.add(li.next().getSectionType()+"");
} }
} }
if (ffs.getSections().getSectionsList() != null) { if (ffs.getSections().getSectionsList() != null) {