MdeModulePkg/DisplayEngine: Return the selectable menu correctly

When returning selectable menu, should return the menu in current form,
the codes miss to do the check. Now returning the selectable menu behind
the codes "if ((UINTN) Distance + NextMenuOption->Skip > GapToTop)".
Then can cover the check, can return the menu correctly.

https://bugzilla.tianocore.org/show_bug.cgi?id=232

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
Dandan Bi 2016-11-22 10:39:38 +08:00 committed by Star Zeng
parent b857bf4813
commit 0265811dbe
1 changed files with 8 additions and 5 deletions

View File

@ -1050,12 +1050,8 @@ MoveToNextStatement (
UpdateOptionSkipLines (NextMenuOption);
}
if (IsSelectable (NextMenuOption)) {
break;
}
//
// In this case, still can't find the selectable menu,
// Check whether the menu is beyond current showing form,
// return the first one beyond the showing form.
//
if ((UINTN) Distance + NextMenuOption->Skip > GapToTop) {
@ -1065,6 +1061,13 @@ MoveToNextStatement (
break;
}
//
// return the selectable menu in the showing form.
//
if (IsSelectable (NextMenuOption)) {
break;
}
Distance += NextMenuOption->Skip;
//