From b2f35637da091be37748203a5817a1c732c69e12 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Sun, 26 Jul 2015 08:03:44 +0000 Subject: MdeModulePkg: Check the case caused by mismatch 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 Reviewed-by: Liming Gao Signed-off-by: Laszlo Ersek git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18053 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c index ae3038b6cb..9612f7665e 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c @@ -1782,14 +1782,15 @@ FindTopMenu ( TopRow = gStatementDimensions.TopRow + SCROLL_ARROW_HEIGHT; BottomRow = gStatementDimensions.BottomRow - SCROLL_ARROW_HEIGHT; - - if (gMisMatch) { + // + // When option mismatch happens,there exist two cases,one is reenter the form, just like the if case below, + // and the other is exit current form and enter last form, it can be covered by the else case. + // + if (gMisMatch && gFormData->HiiHandle == gHighligthMenuInfo.HiiHandle && gFormData->FormId == gHighligthMenuInfo.FormId) { // // Reenter caused by option mismatch or auto exit caused by refresh form(refresh interval/guid), // base on the record highlight info to find the highlight menu. // - ASSERT (gFormData->HiiHandle == gHighligthMenuInfo.HiiHandle && - gFormData->FormId == gHighligthMenuInfo.FormId); *HighlightMenu = FindHighLightMenuOption(NULL); if (*HighlightMenu != NULL) { @@ -1840,7 +1841,6 @@ FindTopMenu ( *SkipValue = 0; } - gMisMatch = FALSE; } else if (FormData->HighLightedStatement != NULL) { if (IsSavedHighlightStatement (FormData->HighLightedStatement)) { // @@ -1914,6 +1914,8 @@ FindTopMenu ( *SkipValue = 0; } + gMisMatch = FALSE; + // // First enter to show the menu, update highlight info. // -- cgit v1.2.3