From 7f36d62918c74079a3150b87e23b62445c36b5ab Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Fri, 15 Apr 2016 13:18:41 +0800 Subject: MdeModulePkg/SetupBrowserDxe: Get default from callback for orderedList For orderedlist question, the value is stored in a buffer, not in HiiValue. So when need to get default value from callback function for orderedlist, need to pass the buffer. This patch is to enhance this logic. Cc: Liming Gao Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Eric Dong Reviewed-by: Liming Gao --- MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index b357e29b3c..c36588e4bf 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -3897,6 +3897,7 @@ GetQuestionDefault ( EFI_BROWSER_ACTION_REQUEST ActionRequest; INTN Action; CHAR16 *NewString; + EFI_IFR_TYPE_VALUE *TypeValue; Status = EFI_NOT_FOUND; StrValue = NULL; @@ -3917,6 +3918,13 @@ GetQuestionDefault ( // 5, set flags of EFI_IFR_CHECKBOX (provide Standard and Manufacturing default) (lowest priority) // HiiValue = &Question->HiiValue; + TypeValue = &HiiValue->Value; + if (HiiValue->Type == EFI_IFR_TYPE_BUFFER && Question->BufferValue != NULL) { + // + // For orderedlist, need to pass the BufferValue to Callback function. + // + TypeValue = (EFI_IFR_TYPE_VALUE *) Question->BufferValue; + } // // Get Question defaut value from call back function. @@ -3930,7 +3938,7 @@ GetQuestionDefault ( Action, Question->QuestionId, HiiValue->Type, - &HiiValue->Value, + TypeValue, &ActionRequest ); if (!EFI_ERROR (Status)) { -- cgit v1.2.3