]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Bug description:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 8 Mar 2011 06:01:23 +0000 (06:01 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 8 Mar 2011 06:01:23 +0000 (06:01 +0000)
  When the menu is refresh type, and the old string is longer than new string, after refresh, some old string will still show.
The mainly change is:
  1. This change cleans the old string first and then paints the new string.
  2. Fixed old code checks grayout flag not correct.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11354 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SetupBrowserDxe/Ui.c

index 189b6e1dc9dc51ba55313bc64a6e5db6c4511df6..553c2546b29a172a6d7d307eee95be094d1b8de4 100644 (file)
@@ -342,6 +342,7 @@ RefreshForm (
   FORM_BROWSER_STATEMENT          *Question;\r
   EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess;\r
   EFI_BROWSER_ACTION_REQUEST      ActionRequest;\r
+  CHAR16                          *PadString;\r
 \r
   if (gMenuRefreshHead != NULL) {\r
 \r
@@ -373,6 +374,11 @@ RefreshForm (
         for (Index = 0; OptionString[Index] == L' '; Index++)\r
           ;\r
 \r
+        PadString = AllocatePool (gOptionBlockWidth * sizeof (CHAR16));\r
+        SetMem16 (PadString, (gOptionBlockWidth - 1) * sizeof (CHAR16), CHAR_SPACE);\r
+        PadString[gOptionBlockWidth - 1] = 0;\r
+        PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, PadString);\r
+        FreePool (PadString);\r
         PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]);\r
         FreePool (OptionString);\r
       }\r
@@ -2209,7 +2215,7 @@ UiDisplayMenu (
         //\r
         if (gMenuRefreshHead != NULL) {\r
           for (MenuRefreshEntry = gMenuRefreshHead; MenuRefreshEntry != NULL; MenuRefreshEntry = MenuRefreshEntry->Next) {\r
-            if (MenuOption->GrayOut) {\r
+            if (MenuRefreshEntry->MenuOption->GrayOut) {\r
               MenuRefreshEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND;\r
             } else {               \r
               MenuRefreshEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;\r