]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Check the case caused by mismatch
authorDandan Bi <dandan.bi@intel.com>
Sun, 26 Jul 2015 08:03:44 +0000 (08:03 +0000)
committerjljusten <jljusten@Edk2>
Sun, 26 Jul 2015 08:03:44 +0000 (08:03 +0000)
When mismatch happens,there exists one case that exit current
form and display last form.Assert code don't cover this case.
Now add check to handle this situation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18053 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c

index ae3038b6cb57089656e1669308814371fb8bcec3..9612f7665e4b73b68578481bf7d9bd0367d1ee25 100644 (file)
@@ -1782,14 +1782,15 @@ FindTopMenu (
 \r
   TopRow    = gStatementDimensions.TopRow    + SCROLL_ARROW_HEIGHT;\r
   BottomRow = gStatementDimensions.BottomRow - SCROLL_ARROW_HEIGHT;\r
-\r
-  if (gMisMatch) {\r
+  //\r
+  // When option mismatch happens,there exist two cases,one is reenter the form, just like the if case below,\r
+  // and the other is exit current form and enter last form, it can be covered by the else case.\r
+  //\r
+  if (gMisMatch && gFormData->HiiHandle == gHighligthMenuInfo.HiiHandle && gFormData->FormId == gHighligthMenuInfo.FormId) {\r
     //\r
     // Reenter caused by option mismatch or auto exit caused by refresh form(refresh interval/guid), \r
     // base on the record highlight info to find the highlight menu.\r
     //\r
-    ASSERT (gFormData->HiiHandle == gHighligthMenuInfo.HiiHandle &&\r
-            gFormData->FormId == gHighligthMenuInfo.FormId);\r
 \r
     *HighlightMenu = FindHighLightMenuOption(NULL);\r
     if (*HighlightMenu != NULL) {\r
@@ -1840,7 +1841,6 @@ FindTopMenu (
       *SkipValue = 0;\r
     }\r
 \r
-    gMisMatch = FALSE;\r
   } else if (FormData->HighLightedStatement != NULL) {\r
     if (IsSavedHighlightStatement (FormData->HighLightedStatement)) {\r
       //\r
@@ -1914,6 +1914,8 @@ FindTopMenu (
     *SkipValue     = 0;\r
   }\r
 \r
+  gMisMatch = FALSE;\r
+\r
   //\r
   // First enter to show the menu, update highlight info.\r
   //\r