]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Clean the help string and hot key info if an empty form is painting.
authorEric Dong <eric.dong@intel.com>
Tue, 29 Oct 2013 11:22:39 +0000 (11:22 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 29 Oct 2013 11:22:39 +0000 (11:22 +0000)
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

MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c

index 9f6c963153cb3b1c30471597e9eb391e913d536d..fffc67d6954899e8a58a5c239f596762f6a84006 100644 (file)
@@ -2165,10 +2165,6 @@ UiDisplayMenu (
         }\r
 \r
         MenuOption = NULL;\r
-\r
-        if (IsListEmpty (&gMenuOption)) { \r
-          ControlFlag = CfReadKey;\r
-        }\r
       }\r
       break;\r
 \r
@@ -2188,6 +2184,14 @@ UiDisplayMenu (
         break;\r
       }\r
 \r
+      if (IsListEmpty (&gMenuOption)) {\r
+        //\r
+        // No menu option, just update the hotkey filed.\r
+        //\r
+        RefreshKeyHelp(gFormData, NULL, FALSE);\r
+        break;\r
+      }\r
+\r
       if (MenuOption != NULL && TopOfScreen == &MenuOption->Link) {\r
         Temp = SkipValue;\r
       } else {\r
@@ -2372,15 +2376,22 @@ UiDisplayMenu (
       }\r
 \r
       if (Repaint || NewLine) {\r
-        //\r
-        // Don't print anything if it is a NULL help token\r
-        //\r
-        ASSERT(MenuOption != NULL);\r
-        HelpInfo = ((EFI_IFR_STATEMENT_HEADER *) ((CHAR8 *)MenuOption->ThisTag->OpCode + sizeof (EFI_IFR_OP_HEADER)))->Help;\r
-        if (HelpInfo == 0 || !IsSelectable (MenuOption)) {\r
+        if (IsListEmpty (&gMenuOption)) {\r
+          //\r
+          // Don't print anything if no mwnu option.\r
+          //\r
           StringPtr = GetToken (STRING_TOKEN (EMPTY_STRING), gHiiHandle);\r
         } else {\r
-          StringPtr = GetToken (HelpInfo, gFormData->HiiHandle);\r
+          //\r
+          // Don't print anything if it is a NULL help token\r
+          //\r
+          ASSERT(MenuOption != NULL);\r
+          HelpInfo = ((EFI_IFR_STATEMENT_HEADER *) ((CHAR8 *)MenuOption->ThisTag->OpCode + sizeof (EFI_IFR_OP_HEADER)))->Help;\r
+          if (HelpInfo == 0 || !IsSelectable (MenuOption)) {\r
+            StringPtr = GetToken (STRING_TOKEN (EMPTY_STRING), gHiiHandle);\r
+          } else {\r
+            StringPtr = GetToken (HelpInfo, gFormData->HiiHandle);\r
+          }\r
         }\r
 \r
         RowCount      = BottomRow - TopRow + 1;\r
@@ -2706,9 +2717,9 @@ UiDisplayMenu (
       break;\r
 \r
     case CfScreenOperation:\r
-      if (ScreenOperation != UiReset) {\r
+      if ((ScreenOperation != UiReset) && (ScreenOperation != UiHotKey)) {\r
         //\r
-        // If the screen has no menu items, and the user didn't select UiReset\r
+        // If the screen has no menu items, and the user didn't select UiReset or UiHotKey\r
         // ignore the selection and go back to reading keys.\r
         //\r
         if (IsListEmpty (&gMenuOption)) {\r