diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c index e198a5e957..9f50f832aa 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c @@ -2545,6 +2545,8 @@ UiDisplayMenu ( UINTN BottomRow; UINTN Index; CHAR16 *StringPtr; + CHAR16 *StringRightPtr; + CHAR16 *StringErrorPtr; CHAR16 *OptionString; CHAR16 *HelpString; CHAR16 *HelpHeaderString; @@ -2579,6 +2581,7 @@ UiDisplayMenu ( EFI_STRING_ID HelpInfo; UI_EVENT_TYPE EventType; BOOLEAN SkipHighLight; + EFI_HII_VALUE *StatementValue; EventType = UIEventNone; Status = EFI_SUCCESS; @@ -2885,10 +2888,26 @@ UiDisplayMenu ( // ASSERT(MenuOption != NULL); HelpInfo = ((EFI_IFR_STATEMENT_HEADER *) ((CHAR8 *)MenuOption->ThisTag->OpCode + sizeof (EFI_IFR_OP_HEADER)))->Help; + Statement = MenuOption->ThisTag; + StatementValue = &Statement->CurrentValue; if (HelpInfo == 0 || !IsSelectable (MenuOption)) { - StringPtr = GetToken (STRING_TOKEN (EMPTY_STRING), gHiiHandle); + if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP && StatementValue->Value.date.Month== 0xff)||(Statement->OpCode->OpCode == EFI_IFR_TIME_OP && StatementValue->Value.time.Hour == 0xff)){ + StringPtr = GetToken (STRING_TOKEN (GET_TIME_FAIL), gHiiHandle); + } else { + StringPtr = GetToken (STRING_TOKEN (EMPTY_STRING), gHiiHandle); + } } else { - StringPtr = GetToken (HelpInfo, gFormData->HiiHandle); + if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP && StatementValue->Value.date.Month== 0xff)||(Statement->OpCode->OpCode == EFI_IFR_TIME_OP && StatementValue->Value.time.Hour == 0xff)){ + StringRightPtr = GetToken (HelpInfo, gFormData->HiiHandle); + StringErrorPtr = GetToken (STRING_TOKEN (GET_TIME_FAIL), gHiiHandle); + StringPtr = AllocateZeroPool ((StrLen (StringRightPtr) + StrLen (StringErrorPtr)+ 1 ) * sizeof (CHAR16)); + StrCpyS (StringPtr, StrLen (StringRightPtr) + StrLen (StringErrorPtr) + 1, StringRightPtr); + StrCatS (StringPtr, StrLen (StringRightPtr) + StrLen (StringErrorPtr) + 1, StringErrorPtr); + FreePool (StringRightPtr); + FreePool (StringErrorPtr); + } else { + StringPtr = GetToken (HelpInfo, gFormData->HiiHandle); + } } } diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni index 2a06c3d495..5c6ad48433 100644 Binary files a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni and b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni differ diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c index 84ae03eea7..52dc5f29d9 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c @@ -2,7 +2,7 @@ Implementation for handling the User Interface option processing. -Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1278,19 +1278,31 @@ ProcessOptions ( switch (MenuOption->Sequence) { case 0: *OptionString[0] = LEFT_NUMERIC_DELIMITER; - UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Month); + if (QuestionValue->Value.date.Month == 0xff){ + UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"??"); + } else { + UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Month); + } *(OptionString[0] + 3) = DATE_SEPARATOR; break; case 1: SetUnicodeMem (OptionString[0], 4, L' '); - UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Day); + if (QuestionValue->Value.date.Day == 0xff){ + UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"??"); + } else { + UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.date.Day); + } *(OptionString[0] + 6) = DATE_SEPARATOR; break; case 2: SetUnicodeMem (OptionString[0], 7, L' '); - UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%04d", QuestionValue->Value.date.Year); + if (QuestionValue->Value.date.Year == 0xff){ + UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"????"); + } else { + UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%04d", QuestionValue->Value.date.Year); + } *(OptionString[0] + 11) = RIGHT_NUMERIC_DELIMITER; break; } @@ -1310,19 +1322,31 @@ ProcessOptions ( switch (MenuOption->Sequence) { case 0: *OptionString[0] = LEFT_NUMERIC_DELIMITER; - UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Hour); + if (QuestionValue->Value.time.Hour == 0xff){ + UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"??"); + } else { + UnicodeSPrint (OptionString[0] + 1, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Hour); + } *(OptionString[0] + 3) = TIME_SEPARATOR; break; case 1: SetUnicodeMem (OptionString[0], 4, L' '); - UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Minute); + if (QuestionValue->Value.time.Minute == 0xff){ + UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"??"); + } else { + UnicodeSPrint (OptionString[0] + 4, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Minute); + } *(OptionString[0] + 6) = TIME_SEPARATOR; break; case 2: SetUnicodeMem (OptionString[0], 7, L' '); - UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Second); + if (QuestionValue->Value.time.Second == 0xff){ + UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"??"); + } else { + UnicodeSPrint (OptionString[0] + 7, 21 * sizeof (CHAR16), L"%02d", QuestionValue->Value.time.Second); + } *(OptionString[0] + 9) = RIGHT_NUMERIC_DELIMITER; break; } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 4d286179e7..b153dd4bfe 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -1595,7 +1595,16 @@ GetQuestionValue ( } if (EFI_ERROR (Status)) { - return Status; + if (Question->Operand == EFI_IFR_DATE_OP){ + QuestionValue->date.Year = 0xff; + QuestionValue->date.Month = 0xff; + QuestionValue->date.Day = 0xff; + } else { + QuestionValue->time.Hour = 0xff; + QuestionValue->time.Minute = 0xff; + QuestionValue->time.Second = 0xff; + } + return EFI_SUCCESS; } if (Question->Operand == EFI_IFR_DATE_OP) {