X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FSetupBrowserDxe%2FProcessOptions.c;h=c388247a88ff3b044f884c8c83ea1b7649b03b6f;hb=328ce03e55c2d802e1c83739d51c54bbcc92d87b;hp=e654545bf73e84d28c26eb000d495447122c866d;hpb=e2100bfa651cd0d1295ef13451b9cf4adddb8bfa;p=mirror_edk2.git
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c b/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c
index e654545bf7..c388247a88 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c
@@ -2,7 +2,7 @@
Implementation for handling the User Interface option processing.
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -84,12 +84,13 @@ ValueToOption (
{
LIST_ENTRY *Link;
QUESTION_OPTION *Option;
+ INTN Result;
Link = GetFirstNode (&Question->OptionListHead);
while (!IsNull (&Question->OptionListHead, Link)) {
Option = QUESTION_OPTION_FROM_LINK (Link);
- if (CompareHiiValue (&Option->Value, OptionValue, NULL) == 0) {
+ if ((CompareHiiValue (&Option->Value, OptionValue, &Result, NULL) == EFI_SUCCESS) && (Result == 0)) {
return Option;
}
@@ -482,7 +483,7 @@ ProcessOptions (
SetArrayData (ValueArray, ValueType, Index2, 0);
Status = SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
FreePool (*OptionString);
*OptionString = NULL;
@@ -491,7 +492,7 @@ ProcessOptions (
Suppress = FALSE;
if ((OneOfOption->SuppressExpression != NULL) &&
- (OneOfOption->SuppressExpression->Result.Value.b)) {
+ (EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressSuppress)) {
//
// This option is suppressed
//
@@ -502,6 +503,7 @@ ProcessOptions (
Character[0] = LEFT_ONEOF_DELIMITER;
NewStrCat (OptionString[0], Character);
StringPtr = GetToken (OneOfOption->Text, Selection->Handle);
+ ASSERT (StringPtr != NULL);
NewStrCat (OptionString[0], StringPtr);
Character[0] = RIGHT_ONEOF_DELIMITER;
NewStrCat (OptionString[0], Character);
@@ -547,10 +549,10 @@ ProcessOptions (
Option = QUESTION_OPTION_FROM_LINK (Link);
if ((Option->SuppressExpression == NULL) ||
- !Option->SuppressExpression->Result.Value.b) {
+ (EvaluateExpressionList(Option->SuppressExpression, FALSE, NULL, NULL) == ExpressFalse)) {
CopyMem (QuestionValue, &Option->Value, sizeof (EFI_HII_VALUE));
SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
break;
}
@@ -563,7 +565,7 @@ ProcessOptions (
}
if ((OneOfOption->SuppressExpression != NULL) &&
- (OneOfOption->SuppressExpression->Result.Value.b)) {
+ ((EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressSuppress))) {
//
// This option is suppressed
//
@@ -582,12 +584,12 @@ ProcessOptions (
OneOfOption = QUESTION_OPTION_FROM_LINK (Link);
if ((OneOfOption->SuppressExpression == NULL) ||
- !OneOfOption->SuppressExpression->Result.Value.b) {
+ (EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressFalse)) {
Suppress = FALSE;
CopyMem (QuestionValue, &OneOfOption->Value, sizeof (EFI_HII_VALUE));
SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
- gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
+ gST->ConOut->SetAttribute (gST->ConOut, PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND);
break;
}
@@ -599,6 +601,7 @@ ProcessOptions (
Character[0] = LEFT_ONEOF_DELIMITER;
NewStrCat (OptionString[0], Character);
StringPtr = GetToken (OneOfOption->Text, Selection->Handle);
+ ASSERT (StringPtr != NULL);
NewStrCat (OptionString[0], StringPtr);
Character[0] = RIGHT_ONEOF_DELIMITER;
NewStrCat (OptionString[0], Character);
@@ -638,7 +641,7 @@ ProcessOptions (
// Save Question value
//
Status = SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
}
if (QuestionValue->Value.b) {
@@ -697,7 +700,7 @@ ProcessOptions (
case 2:
SetUnicodeMem (OptionString[0], 7, L' ');
- UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%4d", QuestionValue->Value.date.Year);
+ UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%04d", QuestionValue->Value.date.Year);
*(OptionString[0] + 11) = RIGHT_NUMERIC_DELIMITER;
break;
}
@@ -740,6 +743,7 @@ ProcessOptions (
if (Selected) {
StringPtr = AllocateZeroPool ((Maximum + 1) * sizeof (CHAR16));
ASSERT (StringPtr);
+ CopyMem(StringPtr, Question->BufferValue, Maximum * sizeof (CHAR16));
Status = ReadString (MenuOption, gPromptForData, StringPtr);
if (!EFI_ERROR (Status)) {
@@ -751,7 +755,7 @@ ProcessOptions (
CopyMem (Question->BufferValue, StringPtr, Maximum * sizeof (CHAR16));
SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
}
}