Enhance SetupBrowser to support new UEFI HiiFormMap feature

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10069 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2010-02-25 10:10:59 +00:00
parent 234980f6e9
commit 2573712e01
10 changed files with 1022 additions and 99 deletions

View File

@@ -661,6 +661,10 @@ GetToken (
{
EFI_STRING String;
if (HiiHandle == NULL) {
return NULL;
}
String = HiiGetString (HiiHandle, Token, NULL);
if (String == NULL) {
String = AllocateCopyPool (sizeof (mUnknownString), mUnknownString);
@@ -1041,6 +1045,20 @@ GetQuestionValue (
}
return Status;
}
//
// Get question value by read expression.
//
if (Question->ReadExpression != NULL && Form->FormType == STANDARD_MAP_FORM_TYPE) {
Status = EvaluateExpression (FormSet, Form, Question->ReadExpression);
if (!EFI_ERROR (Status) && (Question->ReadExpression->Result.Type < EFI_IFR_TYPE_OTHER)) {
//
// Only update question value to the valid result.
//
CopyMem (&Question->HiiValue, &Question->ReadExpression->Result, sizeof (EFI_HII_VALUE));
return EFI_SUCCESS;
}
}
//
// Question value is provided by RTC
@@ -1369,6 +1387,16 @@ SetQuestionValue (
if (Question->ValueExpression != NULL) {
return Status;
}
//
// Before set question value, evaluate its write expression.
//
if (Question->WriteExpression != NULL && Form->FormType == STANDARD_MAP_FORM_TYPE) {
Status = EvaluateExpression (FormSet, Form, Question->WriteExpression);
if (EFI_ERROR (Status)) {
return Status;
}
}
//
// Question value is provided by RTC