Save the type of OneOf question.
authorqwang12 <qwang12@de2fecce-e211-0410-80a6-f3fac2684e05>
Tue, 2 Sep 2008 01:25:55 +0000 (01:25 +0000)
committerqwang12 <qwang12@de2fecce-e211-0410-80a6-f3fac2684e05>
Tue, 2 Sep 2008 01:25:55 +0000 (01:25 +0000)
git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@5769 de2fecce-e211-0410-80a6-f3fac2684e05

edk2/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Utility.c

index 98582e8..638d835 100644 (file)
@@ -328,6 +328,13 @@ CreateQuestionIdMap (
   ONE_OF_OPTION_MAP_ENTRY       *OneOfOptionMapEntry;\r
   EFI_IFR_GUID_CLASS            *Class;\r
   EFI_IFR_GUID_SUBCLASS         *SubClass;\r
+  UINT8                         OneOfType;\r
+  EFI_IFR_ONE_OF                *OneOfOpcode;\r
+\r
+  //\r
+  // Set to a invalid value.\r
+  //\r
+  OneOfType = (UINT8) -1;\r
   \r
 \r
   Status = HiiLibExportPackageLists (ThunkContext->UefiHiiHandle, &List, &Size);\r
@@ -402,6 +409,11 @@ CreateQuestionIdMap (
             InsertTailList (QuestionIdMapEntryListHead, &IdMapEntry->Link);\r
           }\r
 \r
+          if (OpCode->OpCode == EFI_IFR_ONE_OF_OP) {\r
+            OneOfOpcode = (EFI_IFR_ONE_OF *) OpCode;\r
+            OneOfType   = OneOfOpcode->Flags & EFI_IFR_NUMERIC_SIZE;\r
+          }\r
+\r
           break;\r
        \r
         case EFI_IFR_GUID_OP:\r
@@ -415,7 +427,12 @@ CreateQuestionIdMap (
 \r
                 OneOfOptionMap->Signature = ONE_OF_OPTION_MAP_SIGNATURE;\r
                 OneOfOptionMap->QuestionId = OptionMap->QuestionId;\r
-                OneOfOptionMap->ValueType = EFI_IFR_TYPE_NUM_SIZE_8;\r
+\r
+                //\r
+                // Make sure OneOfType is initialized.\r
+                //\r
+                ASSERT (OneOfType != (UINT8) -1);\r
+                OneOfOptionMap->ValueType = OneOfType;\r
                 InitializeListHead (&OneOfOptionMap->OneOfOptionMapEntryListHead);\r
                 OneOfOptinMapEntryListHead = &OneOfOptionMap->OneOfOptionMapEntryListHead;\r
                 InsertTailList (&ThunkContext->OneOfOptionMapListHead, &OneOfOptionMap->Link);\r