]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update SetupBrowser to initialize the question value before extract default value...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Nov 2011 07:15:08 +0000 (07:15 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Nov 2011 07:15:08 +0000 (07:15 +0000)
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

MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h

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