/** @file\r
Utility functions for UI presentation.\r
\r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
//\r
// Create the refresh event process function.\r
//\r
- if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) {\r
+ if (!IsZeroGuid (&Statement->RefreshGuid)) {\r
CreateRefreshEventForStatement (Statement);\r
}\r
\r
// Create the refresh guid hook event.\r
// If the statement in this form has refresh event or refresh interval, browser will create this event for display engine.\r
//\r
- if ((!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) || (Statement->RefreshInterval != 0)) {\r
+ if ((!IsZeroGuid (&Statement->RefreshGuid)) || (Statement->RefreshInterval != 0)) {\r
gDisplayFormData.FormRefreshEvent = mValueChangedEvent;\r
}\r
\r
InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);\r
}\r
\r
+ //\r
+ // treat formset as statement outside the form,get its opcode.\r
+ //\r
+ DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));\r
+ ASSERT (DisplayStatement != NULL);\r
+\r
+ DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;\r
+ DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;\r
+ DisplayStatement->OpCode = gCurrentSelection->FormSet->OpCode;\r
+\r
+ InitializeListHead (&DisplayStatement->NestStatementList);\r
+ InitializeListHead (&DisplayStatement->OptionListHead);\r
+\r
+ InsertTailList(&gDisplayFormData.StatementListOSF, &DisplayStatement->DisplayLink);\r
+\r
//\r
// Process the statement in this form.\r
//\r
//\r
// Create the refresh event process function for Form.\r
//\r
- if (!CompareGuid (&gCurrentSelection->Form->RefreshGuid, &gZeroGuid)) {\r
+ if (!IsZeroGuid (&gCurrentSelection->Form->RefreshGuid)) {\r
CreateRefreshEventForForm (gCurrentSelection->Form);\r
if (gDisplayFormData.FormRefreshEvent == NULL) {\r
gDisplayFormData.FormRefreshEvent = mValueChangedEvent;\r
CopyMem (&Selection->FormSetGuid,&Statement->HiiValue.Value.ref.FormSetGuid, sizeof (EFI_GUID));\r
Selection->FormId = Statement->HiiValue.Value.ref.FormId;\r
Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId;\r
- } else if (!CompareGuid (&Statement->HiiValue.Value.ref.FormSetGuid, &gZeroGuid)) {\r
+ } else if (!IsZeroGuid (&Statement->HiiValue.Value.ref.FormSetGuid)) {\r
if (Selection->Form->ModalForm) {\r
return Status;\r
}\r
\r
ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth);\r
if (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth) {\r
+ ZeroMem (Statement->BufferValue, Statement->StorageWidth);\r
CopyMem (Statement->BufferValue, NewString, StrSize (NewString));\r
} else {\r
CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth);\r
\r
ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth);\r
if (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth) {\r
+ ZeroMem (Statement->BufferValue, Statement->StorageWidth);\r
CopyMem (Statement->BufferValue, NewString, StrSize (NewString));\r
} else {\r
CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth);\r
mCurFakeQestId = 0;\r
\r
do {\r
+\r
+ //\r
+ // Reset Status to prevent the next break from returning incorrect error status.\r
+ //\r
+ Status = EFI_SUCCESS;\r
+\r
//\r
// IFR is updated, force to reparse the IFR binary\r
// This check is shared by EFI_BROWSER_ACTION_FORM_CLOSE and \r
//\r
if (EFI_ERROR (Status)) {\r
//\r
- // Cross reference will not be taken\r
+ // Cross reference will not be taken, restore all essential field\r
//\r
- Selection->FormId = Selection->Form->FormId;\r
+ Selection->Handle = mCurrentHiiHandle;\r
+ CopyMem (&Selection->FormSetGuid, &mCurrentFormSetGuid, sizeof (EFI_GUID));\r
+ Selection->FormId = mCurrentFormId;\r
Selection->QuestionId = 0;\r
+ Selection->Action = UI_ACTION_REFRESH_FORM;\r
}\r
}\r
\r