]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SetupBrowserDxe: Get default from callback for orderedList
authorDandan Bi <dandan.bi@intel.com>
Fri, 15 Apr 2016 05:18:41 +0000 (13:18 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 19 Apr 2016 09:48:11 +0000 (17:48 +0800)
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 <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c

index b357e29b3c6cce5a990b31d6b13c9f98ef26fc08..c36588e4bf07e9e5bab6a2c058780be30341f5cc 100644 (file)
@@ -3897,6 +3897,7 @@ GetQuestionDefault (
   EFI_BROWSER_ACTION_REQUEST      ActionRequest;\r
   INTN                            Action;\r
   CHAR16                          *NewString;\r
+  EFI_IFR_TYPE_VALUE              *TypeValue;\r
 \r
   Status   = EFI_NOT_FOUND;\r
   StrValue = NULL;\r
@@ -3917,6 +3918,13 @@ GetQuestionDefault (
   //  5, set flags of EFI_IFR_CHECKBOX (provide Standard and Manufacturing default) (lowest priority)\r
   //\r
   HiiValue = &Question->HiiValue;\r
+  TypeValue = &HiiValue->Value;\r
+  if (HiiValue->Type == EFI_IFR_TYPE_BUFFER && Question->BufferValue != NULL) {\r
+    //\r
+    // For orderedlist, need to pass the BufferValue to Callback function.\r
+    //\r
+    TypeValue = (EFI_IFR_TYPE_VALUE *) Question->BufferValue;\r
+  }\r
 \r
   //\r
   // Get Question defaut value from call back function.\r
@@ -3930,7 +3938,7 @@ GetQuestionDefault (
                              Action,\r
                              Question->QuestionId,\r
                              HiiValue->Type,\r
-                             &HiiValue->Value,\r
+                             TypeValue,\r
                              &ActionRequest\r
                              );\r
     if (!EFI_ERROR (Status)) {\r