From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ECF5A81E1F for ; Mon, 21 Nov 2016 19:15:38 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP; 21 Nov 2016 19:15:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,678,1473145200"; d="scan'208";a="33302972" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga004.jf.intel.com with ESMTP; 21 Nov 2016 19:15:37 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Liming Gao , Eric Dong Date: Tue, 22 Nov 2016 11:15:09 +0800 Message-Id: <1479784509-57184-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [patch] MdeModulePkg/DisplayEngine: Return the selectable menu correctly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2016 03:15:39 -0000 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. Cc: Liming Gao Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- MdeModulePkg/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 c2cffec..316e2e3 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c @@ -1048,25 +1048,28 @@ MoveToNextStatement ( // if (NextMenuOption->Row == 0) { 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) { if (FindInForm) { NextMenuOption = PreMenuOption; } break; } + // + // return the selectable menu in the showing form. + // + if (IsSelectable (NextMenuOption)) { + break; + } + Distance += NextMenuOption->Skip; // // Arrive at begin of the menu list. // -- 1.9.5.msysgit.1