]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
Do the following enhancement for SetupBrowser:
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.c
index e06228d4aa7f020b11b932943d44143baf654fde..4896a076a57f5ae159242dd5e1d75f8296abe8fc 100644 (file)
@@ -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
@@ -2076,19 +2077,21 @@ LoadFormConfig (
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
-    \r
+\r
+    if ((Question->Operand == EFI_IFR_STRING_OP) || (Question->Operand == EFI_IFR_PASSWORD_OP)) {\r
+      HiiSetString (FormSet->HiiHandle, Question->HiiValue.Value.string, (CHAR16*)Question->BufferValue, NULL);\r
+    }\r
+\r
     //\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
@@ -2110,12 +2113,7 @@ LoadFormConfig (
         ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;\r
         HiiValue = &Question->HiiValue;\r
         BufferValue = (UINT8 *) &Question->HiiValue.Value;\r
-        if (HiiValue->Type == EFI_IFR_TYPE_STRING) {\r
-          //\r
-          // Create String in HII database for Configuration Driver to retrieve\r
-          //\r
-          HiiValue->Value.string = NewString ((CHAR16 *) Question->BufferValue, FormSet->HiiHandle);\r
-        } else if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {\r
+        if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {\r
           BufferValue = Question->BufferValue;\r
         }\r
 \r
@@ -2127,14 +2125,6 @@ LoadFormConfig (
                                  (EFI_IFR_TYPE_VALUE *) BufferValue,\r
                                  &ActionRequest\r
                                  );\r
-\r
-        if (HiiValue->Type == EFI_IFR_TYPE_STRING) {\r
-          //\r
-          // Clean the String in HII Database\r
-          //\r
-          DeleteString (HiiValue->Value.string, FormSet->HiiHandle);\r
-        }\r
-\r
         if (!EFI_ERROR (Status)) {\r
           switch (ActionRequest) {\r
           case EFI_BROWSER_ACTION_REQUEST_RESET:\r