From 81da6ef925f234f66ceb8af1598127260ed5d09e Mon Sep 17 00:00:00 2001 From: ydong10 Date: Tue, 8 Mar 2011 06:01:23 +0000 Subject: [PATCH] Bug description: 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c index 189b6e1dc9..553c2546b2 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c @@ -342,6 +342,7 @@ RefreshForm ( FORM_BROWSER_STATEMENT *Question; EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess; EFI_BROWSER_ACTION_REQUEST ActionRequest; + CHAR16 *PadString; if (gMenuRefreshHead != NULL) { @@ -373,6 +374,11 @@ RefreshForm ( for (Index = 0; OptionString[Index] == L' '; Index++) ; + PadString = AllocatePool (gOptionBlockWidth * sizeof (CHAR16)); + SetMem16 (PadString, (gOptionBlockWidth - 1) * sizeof (CHAR16), CHAR_SPACE); + PadString[gOptionBlockWidth - 1] = 0; + PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, PadString); + FreePool (PadString); PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]); FreePool (OptionString); } @@ -2209,7 +2215,7 @@ UiDisplayMenu ( // if (gMenuRefreshHead != NULL) { for (MenuRefreshEntry = gMenuRefreshHead; MenuRefreshEntry != NULL; MenuRefreshEntry = MenuRefreshEntry->Next) { - if (MenuOption->GrayOut) { + if (MenuRefreshEntry->MenuOption->GrayOut) { MenuRefreshEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND; } else { MenuRefreshEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND; -- 2.39.2