From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ml01.01.org (Postfix) with ESMTP id 09AF91A1E05 for ; Thu, 18 Aug 2016 23:16:09 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 18 Aug 2016 23:16:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,544,1464678000"; d="scan'208";a="158233049" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga004.fm.intel.com with ESMTP; 18 Aug 2016 23:16:07 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Liming Gao , Eric Dong Date: Fri, 19 Aug 2016 14:15:51 +0800 Message-Id: <1471587351-146472-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [patch] MdeModulePkg/Browser: Fix conflicting policy in getting default of checkbox 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: Fri, 19 Aug 2016 06:16:09 -0000 From: Liming Gao We have added a new policy to get default value for question: get default from other default id if current default is not specified. But when getting default value for checkbox, if the default flag is not set, it will set the default value to FALSE for checkbox. This behavior in checkbox conflicts with the new added policy, so now we move this behavior to the end of getting default form other default id. Cc: Liming Gao Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index cd3c8cc..00f4b41 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -4239,12 +4239,10 @@ ReGetDefault: // if (((DefaultId == EFI_HII_DEFAULT_CLASS_STANDARD) && ((Question->Flags & EFI_IFR_CHECKBOX_DEFAULT) != 0)) || ((DefaultId == EFI_HII_DEFAULT_CLASS_MANUFACTURING) && ((Question->Flags & EFI_IFR_CHECKBOX_DEFAULT_MFG) != 0)) ) { HiiValue->Value.b = TRUE; - } else { - HiiValue->Value.b = FALSE; } return EFI_SUCCESS; } } @@ -4267,10 +4265,15 @@ ReGetDefault: // // For Questions without default value for all the default id in the DefaultStoreList. // Status = EFI_NOT_FOUND; switch (Question->Operand) { + case EFI_IFR_CHECKBOX_OP: + HiiValue->Value.b = FALSE; + Status = EFI_SUCCESS; + break; + case EFI_IFR_NUMERIC_OP: // // Take minimum value as numeric default value // if ((Question->Flags & EFI_IFR_DISPLAY) == 0) { -- 1.9.5.msysgit.1