Added some checks to see if the attributes were set - clears up some warning messages when trying to unset an attribute that was not set.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1024 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lhauch 2006-07-16 08:26:44 +00:00
parent 97796eaa70
commit 322b772308
2 changed files with 45 additions and 17 deletions

View File

@ -340,24 +340,31 @@ public class SpdFileContents {
if (instanceVer != null){
lc.setRecommendedInstanceVersion(instanceVer);
} else {
if (lc.isSetRecommendedInstanceVersion()) {
lc.unsetRecommendedInstanceVersion();
}
}
} else {
if (lc.isSetRecommendedInstanceGuid()) {
lc.unsetRecommendedInstanceGuid();
lc.unsetRecommendedInstanceVersion();
}
}
if (stringToList(hdrAttribArch) != null){
lc.setSupArchList(stringToList(hdrAttribArch));
} else {
if (lc.isSetSupArchList()) {
lc.unsetSupArchList();
}
}
if (stringToList(hdrAttribModType) != null){
lc.setSupModuleList(stringToList(hdrAttribModType));
} else {
if (lc.isSetSupModuleList()) {
lc.unsetSupModuleList();
}
}
}
cursor.dispose();
}
@ -400,20 +407,26 @@ public class SpdFileContents {
e.setGuidTypeList(stringToList(guidTypeList));
}
else{
if (e.isSetGuidTypeList()) {
e.unsetGuidTypeList();
}
}
if (stringToList(archList) != null){
e.setSupArchList(stringToList(archList));
}
else{
if (e.isSetSupArchList()) {
e.unsetSupArchList();
}
}
if (stringToList(modTypeList) != null) {
e.setSupModuleList(stringToList(modTypeList));
}
else{
if (e.isSetSupModuleList()) {
e.unsetSupModuleList();
}
}
}
cursor.dispose();
@ -440,15 +453,19 @@ public class SpdFileContents {
e.setSupArchList(stringToList(archList));
}
else{
if (e.isSetSupArchList()) {
e.unsetSupArchList();
}
}
if (stringToList(modTypeList) != null) {
e.setSupModuleList(stringToList(modTypeList));
}
else{
if (e.isSetSupModuleList()) {
e.unsetSupModuleList();
}
}
}
cursor.dispose();
}
@ -473,15 +490,19 @@ public class SpdFileContents {
e.setSupArchList(stringToList(archList));
}
else{
if (e.isSetSupArchList()) {
e.unsetSupArchList();
}
}
if (stringToList(modTypeList) != null) {
e.setSupModuleList(stringToList(modTypeList));
}
else{
if (e.isSetSupModuleList()) {
e.unsetSupModuleList();
}
}
}
cursor.dispose();
}
@ -989,12 +1010,19 @@ public class SpdFileContents {
*/
if (hdrAttribArch != null) {
lc.setSupArchList(stringToList(hdrAttribArch));
} else {
if (lc.isSetSupArchList()) {
lc.unsetSupArchList();
}
}
if (hdrAttribModType != null) {
lc.setSupModuleList(stringToList(hdrAttribModType));
} else {
if (lc.isSetSupModuleList()) {
lc.unsetSupModuleList();
}
}
}
@ -1278,14 +1306,18 @@ public class SpdFileContents {
if (archList != null){
pe.setSupArchList(stringToList(archList));
} else {
if (pe.isSetSupArchList()) {
pe.unsetSupArchList();
}
}
if (modTypeList != null){
pe.setSupModuleList(stringToList(modTypeList));
} else {
if (pe.isSetSupModuleList()) {
pe.unsetSupModuleList();
}
}
}
/**
Get PpiDeclarations element

View File

@ -251,7 +251,6 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
vModule.add("UEFI_DRIVER");
vModule.add("UEFI_APPLICATION");
vModule.add("USER_DEFINED");
vModule.add("NONE");
jTable.getColumnModel().getColumn(cnSupMod).setCellEditor(new ListEditor(vModule));
@ -293,12 +292,8 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
arch = m.getValueAt(row, cnSupArch).toString();
}
String module = null;
// if (lsm.isSelectionEmpty()) {
if (m.getValueAt(row, cnSupMod) != null) {
module = m.getValueAt(row, cnSupMod).toString();
if (module == "NONE") {
module = null;
}
}
String[] rowData = {lib, hdr, hlp};
if (!dataValidation(rowData)) {
@ -308,7 +303,9 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
// LAH getLibInstances(lib);
// LAH String guid = nameToGuid(name);
if (name != null) {
String guid = nameToGuid(name);
}
// LAH WAS sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module);
sfc.updateSpdLibClass(row, lib, hdr, hlp, null, null, arch, module);
@ -589,8 +586,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
//
//convert to GUID before storing recommended lib instance.
//
getLibInstances(row[0]);
getLibInstances(row[cnClassName]);
// LAH recommendGuid = nameToGuid(row[3]);
// LAH WAS sfc.genSpdLibClassDeclarations(row[0], recommendGuid, row[1], row[2], row[5], null, null, row[4], null, row[6]);