From aa197375d8499fce429dd2dc390b41b53e680d49 Mon Sep 17 00:00:00 2001 From: hche10x Date: Mon, 16 Oct 2006 06:44:56 +0000 Subject: [PATCH] 1. Fix EDKT379: Check if Constructor exists in a library when user adds a destructor 2. Fix EDKT378: Can not add any external definitions to a new created MSA file by wizard 3. Fix a bug in function wrapStringByWord of Tools.java git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1753 6f19259b-4bc3-4df7-8a09-765794883524 --- .../org/tianocore/frameworkwizard/common/Tools.java | 7 +++++++ .../frameworkwizard/module/ui/ModuleExterns.java | 12 +++++++----- .../frameworkwizard/module/ui/dialog/ExternsDlg.java | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java index b29bfe8a7e..e5cce71045 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java @@ -332,6 +332,13 @@ public class Tools { String strTemp = ""; boolean isCopied = true; + if (arg0 == null) { + return ""; + } + if (arg0.length() <= 0) { + return ""; + } + // // Convert string to array by " " // diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java index 4b4ea0daa2..d35bbafa59 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java @@ -472,11 +472,13 @@ public class ModuleExterns extends IInternalFrame implements ItemListener { // Save pcd and flash map information first // Externs ex = Externs.Factory.newInstance(); - if (this.externs.getPcdIsDriver() != null) { - ex.setPcdIsDriver(this.externs.getPcdIsDriver()); - } - if (this.externs.getTianoR8FlashMapH()) { - ex.setTianoR8FlashMapH(this.externs.getTianoR8FlashMapH()); + if (this.externs != null) { + if (this.externs.getPcdIsDriver() != null) { + ex.setPcdIsDriver(this.externs.getPcdIsDriver()); + } + if (this.externs.getTianoR8FlashMapH()) { + ex.setTianoR8FlashMapH(this.externs.getTianoR8FlashMapH()); + } } this.externs = ex; diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java index 3a94511e1e..3aa9b4a297 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java @@ -734,6 +734,10 @@ public class ExternsDlg extends IDialog implements ItemListener { Log.wrn("Update Externs", "At least one of Constructor or Destructor should have a value"); return false; } + if (isEmpty(this.jTextFieldConstructor.getText()) && !isEmpty(this.jTextFieldDestructor.getText())) { + Log.wrn("Update Externs", "You must define a Constructor at the same time when you declare a Destructor"); + return false; + } if (!isEmpty(this.jTextFieldConstructor.getText())) { if (!DataValidation.isC_NameType(this.jTextFieldConstructor.getText())) { Log.wrn("Update Externs", "Incorrect data type for Constructor");