diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-01 09:39:11 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-01 09:39:11 +0000 |
commit | cf4c5a4270f3feb3b5083cb477263ba239154ec7 (patch) | |
tree | 062e6abbf1ab866d81868413d95bd821d17fa416 /MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | |
parent | da0924fe8faf53d6d16067c7d9185a02737d865e (diff) | |
download | edk2-platforms-cf4c5a4270f3feb3b5083cb477263ba239154ec7.tar.xz |
Use the minimum value for Numeric and the first option value for OneOf as their default value when no specific default value is specified.
HII IFR Numeric and OneOf opcode may not specify their default value in opcode. And, zero may not be valid value for them. To make sure the valid value is set to default value, the minimum value for Numeric and the first option value for OneOf will be chosen as default value.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11497 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Setup.c')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 6513071cd4..ea98d46db9 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -1940,6 +1940,15 @@ GetQuestionDefault ( // For Questions without default
//
switch (Question->Operand) {
+ case EFI_IFR_NUMERIC_OP:
+ //
+ // Take minimum value as numeric default value
+ //
+ if ((HiiValue->Value.u64 < Question->Minimum) || (HiiValue->Value.u64 > Question->Maximum)) {
+ HiiValue->Value.u64 = Question->Minimum;
+ }
+ break;
+
case EFI_IFR_ONE_OF_OP:
//
// Take first oneof option as oneof's default value
|