From 61f1b7c51e77b71c0101d4af172aee1d08a1096c Mon Sep 17 00:00:00 2001 From: ydong10 Date: Mon, 27 May 2013 07:04:09 +0000 Subject: [PATCH] Refine the logic about processing options for oneof opcode. Signed-off-by: Eric Dong Reviewed-by: Liming Gao git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14389 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/SetupBrowserDxe/InputHandler.c | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c index ae783b4ae3..844590770a 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c @@ -1023,10 +1023,10 @@ GetSelectionInputPopUp ( for (Index = 0; Index < OptionCount; Index++) { OneOfOption = QUESTION_OPTION_FROM_LINK (Link); Link = GetNextNode (&Question->OptionListHead, Link); - if ((OneOfOption->SuppressExpression == NULL) || - EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressFalse) { - RemoveEntryList (&OneOfOption->Link); - InsertHeadList (&Question->OptionListHead, &OneOfOption->Link); + if ((OneOfOption->SuppressExpression != NULL) && + EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) > ExpressFalse) { + continue; + } else { PopUpMenuLines++; } } @@ -1040,6 +1040,13 @@ GetSelectionInputPopUp ( Link = GetFirstNode (&Question->OptionListHead); for (Index = 0; Index < PopUpMenuLines; Index++) { OneOfOption = QUESTION_OPTION_FROM_LINK (Link); + Link = GetNextNode (&Question->OptionListHead, Link); + + if (!OrderedList && (OneOfOption->SuppressExpression != NULL) && + EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) > ExpressFalse) { + Index--; + continue; + } StringPtr = GetToken (OneOfOption->Text, MenuOption->Handle); if (StrLen (StringPtr) > PopUpWidth) { @@ -1053,8 +1060,6 @@ GetSelectionInputPopUp ( // HighlightOptionIndex = Index; } - - Link = GetNextNode (&Question->OptionListHead, Link); } // @@ -1123,6 +1128,13 @@ GetSelectionInputPopUp ( Link = GetFirstNode (&Question->OptionListHead); for (Index = 0; Index < TopOptionIndex; Index++) { Link = GetNextNode (&Question->OptionListHead, Link); + + OneOfOption = QUESTION_OPTION_FROM_LINK (Link); + if (!OrderedList && (OneOfOption->SuppressExpression != NULL) && + EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) > ExpressFalse) { + Index--; + continue; + } } // @@ -1133,6 +1145,12 @@ GetSelectionInputPopUp ( OneOfOption = QUESTION_OPTION_FROM_LINK (Link); Link = GetNextNode (&Question->OptionListHead, Link); + if (!OrderedList && (OneOfOption->SuppressExpression != NULL) && + EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) > ExpressFalse) { + Index--; + continue; + } + StringPtr = GetToken (OneOfOption->Text, MenuOption->Handle); ASSERT (StringPtr != NULL); //