Revision: 14815
          http://sourceforge.net/p/edk2/code/14815
Author:   ydong10
Date:     2013-10-29 11:22:39 +0000 (Tue, 29 Oct 2013)
Log Message:
-----------
Clean the help string and hot key info if an empty form is painting.

Signed-off-by: Eric Dong <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c

Modified: trunk/edk2/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c    
2013-10-29 08:52:01 UTC (rev 14814)
+++ trunk/edk2/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c    
2013-10-29 11:22:39 UTC (rev 14815)
@@ -2165,10 +2165,6 @@
         }
 
         MenuOption = NULL;
-
-        if (IsListEmpty (&gMenuOption)) { 
-          ControlFlag = CfReadKey;
-        }
       }
       break;
 
@@ -2188,6 +2184,14 @@
         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 @@
       }
 
       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 @@
       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)) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to