Clean the help string and hot key info if an empty form is painting.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14815 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong 2013-10-29 11:22:39 +00:00 committed by ydong10
parent 107e3d7a37
commit 8924aecd47

View File

@ -2165,10 +2165,6 @@ UiDisplayMenu (
} }
MenuOption = NULL; MenuOption = NULL;
if (IsListEmpty (&gMenuOption)) {
ControlFlag = CfReadKey;
}
} }
break; break;
@ -2188,6 +2184,14 @@ UiDisplayMenu (
break; break;
} }
if (IsListEmpty (&gMenuOption)) {
//
// No menu option, just update the hotkey filed.
//
RefreshKeyHelp(gFormData, NULL, FALSE);
break;
}
if (MenuOption != NULL && TopOfScreen == &MenuOption->Link) { if (MenuOption != NULL && TopOfScreen == &MenuOption->Link) {
Temp = SkipValue; Temp = SkipValue;
} else { } else {
@ -2372,6 +2376,12 @@ UiDisplayMenu (
} }
if (Repaint || NewLine) { if (Repaint || NewLine) {
if (IsListEmpty (&gMenuOption)) {
//
// Don't print anything if no mwnu option.
//
StringPtr = GetToken (STRING_TOKEN (EMPTY_STRING), gHiiHandle);
} else {
// //
// Don't print anything if it is a NULL help token // Don't print anything if it is a NULL help token
// //
@ -2382,6 +2392,7 @@ UiDisplayMenu (
} else { } else {
StringPtr = GetToken (HelpInfo, gFormData->HiiHandle); StringPtr = GetToken (HelpInfo, gFormData->HiiHandle);
} }
}
RowCount = BottomRow - TopRow + 1; RowCount = BottomRow - TopRow + 1;
HelpPageIndex = 0; HelpPageIndex = 0;
@ -2706,9 +2717,9 @@ UiDisplayMenu (
break; break;
case CfScreenOperation: 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. // ignore the selection and go back to reading keys.
// //
if (IsListEmpty (&gMenuOption)) { if (IsListEmpty (&gMenuOption)) {