]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
Fix AutoUpdateLangVariable() logic to handle the case PlatformLang/Lang is set before...
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.c
index d50071e5506215c299a2b8506824ca3ca9ad172f..740ee50d0b82a3a29c8db96d77ae1242b71f6bac 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
 Entry and initialization module for the browser.\r
 \r
-Copyright (c) 2007 - 2010, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -269,7 +269,8 @@ SendForm (
 \r
   gOptionBlockWidth = (CHAR16) ((gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3);\r
   gHelpBlockWidth   = gOptionBlockWidth;\r
-  gPromptBlockWidth = gOptionBlockWidth;\r
+  gPromptBlockWidth = (CHAR16) (gOptionBlockWidth + LEFT_SKIPPED_COLUMNS);\r
+  gOptionBlockWidth = (CHAR16) (gOptionBlockWidth - LEFT_SKIPPED_COLUMNS);\r
 \r
   //\r
   // Initialize the strings for the browser, upon exit of the browser, the strings will be freed\r
@@ -1679,10 +1680,9 @@ ValidateQuestion (
 \r
 \r
 /**\r
-  Perform NoSubmit check for a Form.\r
+  Perform NoSubmit check for each Form in FormSet.\r
 \r
   @param  FormSet                FormSet data structure.\r
-  @param  Form                   Form data structure.\r
 \r
   @retval EFI_SUCCESS            Form validation pass.\r
   @retval other                  Form validation failed.\r
@@ -1690,24 +1690,32 @@ ValidateQuestion (
 **/\r
 EFI_STATUS\r
 NoSubmitCheck (\r
-  IN  FORM_BROWSER_FORMSET            *FormSet,\r
-  IN  FORM_BROWSER_FORM               *Form\r
+  IN  FORM_BROWSER_FORMSET            *FormSet\r
   )\r
 {\r
   EFI_STATUS              Status;\r
   LIST_ENTRY              *Link;\r
   FORM_BROWSER_STATEMENT  *Question;\r
+  FORM_BROWSER_FORM       *Form;\r
+  LIST_ENTRY              *LinkForm;\r
 \r
-  Link = GetFirstNode (&Form->StatementListHead);\r
-  while (!IsNull (&Form->StatementListHead, Link)) {\r
-    Question = FORM_BROWSER_STATEMENT_FROM_LINK (Link);\r
+  LinkForm = GetFirstNode (&FormSet->FormListHead);\r
+  while (!IsNull (&FormSet->FormListHead, LinkForm)) {\r
+    Form = FORM_BROWSER_FORM_FROM_LINK (LinkForm);\r
 \r
-    Status = ValidateQuestion (FormSet, Form, Question, EFI_HII_EXPRESSION_NO_SUBMIT_IF);\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
+    Link = GetFirstNode (&Form->StatementListHead);\r
+    while (!IsNull (&Form->StatementListHead, Link)) {\r
+      Question = FORM_BROWSER_STATEMENT_FROM_LINK (Link);\r
+\r
+      Status = ValidateQuestion (FormSet, Form, Question, EFI_HII_EXPRESSION_NO_SUBMIT_IF);\r
+      if (EFI_ERROR (Status)) {\r
+        return Status;\r
+      }\r
+\r
+      Link = GetNextNode (&Form->StatementListHead, Link);\r
     }\r
 \r
-    Link = GetNextNode (&Form->StatementListHead, Link);\r
+    LinkForm = GetNextNode (&FormSet->FormListHead, LinkForm);\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -1738,7 +1746,7 @@ SubmitForm (
   //\r
   // Validate the Form by NoSubmit check\r
   //\r
-  Status = NoSubmitCheck (FormSet, Form);\r
+  Status = NoSubmitCheck (FormSet);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -2073,15 +2081,13 @@ LoadFormConfig (
     //\r
     // Check whether EfiVarstore with CallBack can be got.\r
     //\r
-    if ((Question->QuestionId != 0) && (Question->Storage != NULL) &&\r
+    if ((FormSet->ConfigAccess != NULL) &&\r
+        (Selection->Action != UI_ACTION_REFRESH_FORMSET) &&\r
+        (Question->QuestionId != 0) && \r
+        (Question->Storage != NULL) &&\r
         (Question->Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE) && \r
         ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK)) {\r
-      //\r
-      // ConfigAccess can't be NULL.\r
-      //\r
-      if (FormSet->ConfigAccess == NULL) {\r
-        return EFI_UNSUPPORTED;\r
-      }\r
+\r
       //\r
       // Check QuestionValue does exist.\r
       //\r