From 0265811dbe56cf46fb3c152b2ccdefd8fb47a170 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Tue, 22 Nov 2016 10:39:38 +0800 Subject: [PATCH] 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 Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Eric Dong --- .../Universal/DisplayEngineDxe/FormDisplay.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c index c2cffecbe9..316e2e3705 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c @@ -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; // -- 2.39.2