From: Eric Dong Date: Tue, 29 Oct 2013 11:22:39 +0000 (+0000) Subject: Clean the help string and hot key info if an empty form is painting. X-Git-Tag: edk2-stable201903~12142 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=8924aecd470f84968369982a69aa30acc7c387df Clean the help string and hot key info if an empty form is painting. Signed-off-by: Eric Dong Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14815 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c index 9f6c963153..fffc67d695 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c @@ -2165,10 +2165,6 @@ UiDisplayMenu ( } MenuOption = NULL; - - if (IsListEmpty (&gMenuOption)) { - ControlFlag = CfReadKey; - } } break; @@ -2188,6 +2184,14 @@ UiDisplayMenu ( break; } + if (IsListEmpty (&gMenuOption)) { + // + // No menu option, just update the hotkey filed. + // + RefreshKeyHelp(gFormData, NULL, FALSE); + break; + } + if (MenuOption != NULL && TopOfScreen == &MenuOption->Link) { Temp = SkipValue; } else { @@ -2372,15 +2376,22 @@ UiDisplayMenu ( } if (Repaint || NewLine) { - // - // Don't print anything if it is a NULL help token - // - ASSERT(MenuOption != NULL); - HelpInfo = ((EFI_IFR_STATEMENT_HEADER *) ((CHAR8 *)MenuOption->ThisTag->OpCode + sizeof (EFI_IFR_OP_HEADER)))->Help; - if (HelpInfo == 0 || !IsSelectable (MenuOption)) { + if (IsListEmpty (&gMenuOption)) { + // + // Don't print anything if no mwnu option. + // StringPtr = GetToken (STRING_TOKEN (EMPTY_STRING), gHiiHandle); } else { - StringPtr = GetToken (HelpInfo, gFormData->HiiHandle); + // + // Don't print anything if it is a NULL help token + // + ASSERT(MenuOption != NULL); + HelpInfo = ((EFI_IFR_STATEMENT_HEADER *) ((CHAR8 *)MenuOption->ThisTag->OpCode + sizeof (EFI_IFR_OP_HEADER)))->Help; + if (HelpInfo == 0 || !IsSelectable (MenuOption)) { + StringPtr = GetToken (STRING_TOKEN (EMPTY_STRING), gHiiHandle); + } else { + StringPtr = GetToken (HelpInfo, gFormData->HiiHandle); + } } RowCount = BottomRow - TopRow + 1; @@ -2706,9 +2717,9 @@ UiDisplayMenu ( break; case CfScreenOperation: - if (ScreenOperation != UiReset) { + if ((ScreenOperation != UiReset) && (ScreenOperation != UiHotKey)) { // - // If the screen has no menu items, and the user didn't select UiReset + // If the screen has no menu items, and the user didn't select UiReset or UiHotKey // ignore the selection and go back to reading keys. // if (IsListEmpty (&gMenuOption)) {