Implementation for handling the User Interface option processing.\r
\r
\r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
{\r
LIST_ENTRY *Link;\r
QUESTION_OPTION *Option;\r
+ INTN Result;\r
\r
Link = GetFirstNode (&Question->OptionListHead);\r
while (!IsNull (&Question->OptionListHead, Link)) {\r
Option = QUESTION_OPTION_FROM_LINK (Link);\r
\r
- if (CompareHiiValue (&Option->Value, OptionValue, NULL) == 0) {\r
+ if ((CompareHiiValue (&Option->Value, OptionValue, &Result, NULL) == EFI_SUCCESS) && (Result == 0)) {\r
return Option;\r
}\r
\r
SetArrayData (ValueArray, ValueType, Index2, 0);\r
\r
Status = SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);\r
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
\r
FreePool (*OptionString);\r
*OptionString = NULL;\r
\r
Suppress = FALSE;\r
if ((OneOfOption->SuppressExpression != NULL) &&\r
- (OneOfOption->SuppressExpression->Result.Value.b)) {\r
+ (EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressSuppress)) {\r
//\r
// This option is suppressed\r
//\r
Character[0] = LEFT_ONEOF_DELIMITER;\r
NewStrCat (OptionString[0], Character);\r
StringPtr = GetToken (OneOfOption->Text, Selection->Handle);\r
+ ASSERT (StringPtr != NULL);\r
NewStrCat (OptionString[0], StringPtr);\r
Character[0] = RIGHT_ONEOF_DELIMITER;\r
NewStrCat (OptionString[0], Character);\r
Option = QUESTION_OPTION_FROM_LINK (Link);\r
\r
if ((Option->SuppressExpression == NULL) ||\r
- !Option->SuppressExpression->Result.Value.b) {\r
+ (EvaluateExpressionList(Option->SuppressExpression, FALSE, NULL, NULL) == ExpressFalse)) {\r
CopyMem (QuestionValue, &Option->Value, sizeof (EFI_HII_VALUE));\r
SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);\r
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
break;\r
}\r
\r
}\r
\r
if ((OneOfOption->SuppressExpression != NULL) &&\r
- (OneOfOption->SuppressExpression->Result.Value.b)) {\r
+ ((EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressSuppress))) {\r
//\r
// This option is suppressed\r
//\r
OneOfOption = QUESTION_OPTION_FROM_LINK (Link);\r
\r
if ((OneOfOption->SuppressExpression == NULL) ||\r
- !OneOfOption->SuppressExpression->Result.Value.b) {\r
+ (EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressFalse)) {\r
Suppress = FALSE;\r
CopyMem (QuestionValue, &OneOfOption->Value, sizeof (EFI_HII_VALUE));\r
SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);\r
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
gST->ConOut->SetAttribute (gST->ConOut, PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND);\r
break;\r
}\r
Character[0] = LEFT_ONEOF_DELIMITER;\r
NewStrCat (OptionString[0], Character);\r
StringPtr = GetToken (OneOfOption->Text, Selection->Handle);\r
+ ASSERT (StringPtr != NULL);\r
NewStrCat (OptionString[0], StringPtr);\r
Character[0] = RIGHT_ONEOF_DELIMITER;\r
NewStrCat (OptionString[0], Character);\r
// Save Question value\r
//\r
Status = SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);\r
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
}\r
\r
if (QuestionValue->Value.b) {\r
\r
case 2:\r
SetUnicodeMem (OptionString[0], 7, L' ');\r
- UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%4d", QuestionValue->Value.date.Year);\r
+ UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%04d", QuestionValue->Value.date.Year);\r
*(OptionString[0] + 11) = RIGHT_NUMERIC_DELIMITER;\r
break;\r
}\r
if (Selected) {\r
StringPtr = AllocateZeroPool ((Maximum + 1) * sizeof (CHAR16));\r
ASSERT (StringPtr);\r
+ CopyMem(StringPtr, Question->BufferValue, Maximum * sizeof (CHAR16));\r
\r
Status = ReadString (MenuOption, gPromptForData, StringPtr);\r
if (!EFI_ERROR (Status)) {\r
CopyMem (Question->BufferValue, StringPtr, Maximum * sizeof (CHAR16));\r
SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);\r
\r
- UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
+ UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
}\r
}\r
\r