]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/DisplayEngine: Return the selectable menu correctly
authorDandan Bi <dandan.bi@intel.com>
Tue, 22 Nov 2016 02:39:38 +0000 (10:39 +0800)
committerStar Zeng <star.zeng@intel.com>
Wed, 23 Nov 2016 02:11:47 +0000 (10:11 +0800)
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>
MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c

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