\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
*SkipValue = 0;\r
}\r
\r
- gMisMatch = FALSE;\r
} else if (FormData->HighLightedStatement != NULL) {\r
if (IsSavedHighlightStatement (FormData->HighLightedStatement)) {\r
//\r
*SkipValue = 0;\r
}\r
\r
+ gMisMatch = FALSE;\r
+\r
//\r
// First enter to show the menu, update highlight info.\r
//\r
do {\r
CreateDialog (&Key, gEmptyString, CfmStr, gConfirmOpt, gEmptyString, NULL);\r
} while (((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (gConfirmOptYes[0] | UPPER_LOWER_CASE_OFFSET)) &&\r
- ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (gConfirmOptNo[0] | UPPER_LOWER_CASE_OFFSET)));\r
+ ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (gConfirmOptNo[0] | UPPER_LOWER_CASE_OFFSET)) &&\r
+ (Key.ScanCode != SCAN_ESC));\r
\r
if ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) == (gConfirmOptYes[0] | UPPER_LOWER_CASE_OFFSET)) {\r
RetVal = TRUE;\r
//\r
if (HelpLine > 2 * RowCount - 2) {\r
HelpPageCount = (HelpLine - RowCount + 1) / (RowCount - 2) + 1;\r
- if ((HelpLine - RowCount + 1) % (RowCount - 2) > 1) {\r
+ if ((HelpLine - RowCount + 1) % (RowCount - 2) != 0) {\r
HelpPageCount += 1;\r
}\r
} else {\r