Update SetupBrowser to initialize the question value before extract default value so that the default expression can be evaluated correctly.

Signed-off-by: lgao4
Reviewed-by: ydong10

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12757 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2011-11-22 07:15:08 +00:00
parent 6ff84d99d3
commit 7d1b202d6e
2 changed files with 15 additions and 2 deletions

View File

@ -3088,7 +3088,15 @@ ExtractDefault (
DestroyFormSet (LocalFormSet);
continue;
}
//
// Initilize Questions' Value
//
LoadFormSetConfig (NULL, LocalFormSet);
if (EFI_ERROR (Status)) {
DestroyFormSet (LocalFormSet);
continue;
}
//
// Add FormSet into the maintain list.
//
@ -3122,6 +3130,7 @@ ExtractDefault (
@param Selection Selection contains the information about
the Selection, form and formset to be displayed.
Selection action may be updated in retrieve callback.
If Selection is NULL, only initialize Question value.
@param FormSet FormSet data structure.
@param Form Form data structure.
@ -3160,7 +3169,7 @@ LoadFormConfig (
//
// According the spec, ref opcode try to get value from call back with "retrieve" type.
//
if ((Question->Operand == EFI_IFR_REF_OP) && (FormSet->ConfigAccess != NULL)) {
if ((Question->Operand == EFI_IFR_REF_OP) && (FormSet->ConfigAccess != NULL) && (Selection != NULL)) {
Status = ProcessCallBackFunction(Selection, Question, EFI_BROWSER_ACTION_RETRIEVE, TRUE);
if (EFI_ERROR (Status)) {
return Status;
@ -3171,6 +3180,7 @@ LoadFormConfig (
// Check whether EfiVarstore with CallBack can be got.
//
if ((FormSet->ConfigAccess != NULL) &&
(Selection != NULL) &&
(Selection->Action != UI_ACTION_REFRESH_FORMSET) &&
(Question->QuestionId != 0) &&
(Question->Storage != NULL) &&
@ -3211,6 +3221,7 @@ LoadFormConfig (
@param Selection Selection contains the information about
the Selection, form and formset to be displayed.
Selection action may be updated in retrieve callback.
If Selection is NULL, only initialize Question value.
@param FormSet FormSet data structure.
@retval EFI_SUCCESS The function completed successfully.

View File

@ -1064,6 +1064,7 @@ ExtractDefault (
@param Selection Selection contains the information about
the Selection, form and formset to be displayed.
Selection action may be updated in retrieve callback.
If Selection is NULL, only initialize Question value.
@param FormSet FormSet data structure.
@param Form Form data structure.
@ -1083,6 +1084,7 @@ LoadFormConfig (
@param Selection Selection contains the information about
the Selection, form and formset to be displayed.
Selection action may be updated in retrieve callback.
If Selection is NULL, only initialize Question value.
@param FormSet FormSet data structure.
@retval EFI_SUCCESS The function completed successfully.