public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg/Browser: Fix conflicting policy in getting default of checkbox
@ 2016-08-19  6:15 Dandan Bi
  2016-08-19  6:57 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Dandan Bi @ 2016-08-19  6:15 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao, Eric Dong

From: Liming Gao <liming.gao@intel.com>

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 <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>
---
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-19  6:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-19  6:15 [patch] MdeModulePkg/Browser: Fix conflicting policy in getting default of checkbox Dandan Bi
2016-08-19  6:57 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox