Update the logic, only check the value change status for user input action, not detect the change caused by Hii driver change through SetBrowserData function.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15229 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1787,14 +1787,6 @@ SetQuestionValue (
|
||||
//
|
||||
CopyMem (Storage->Buffer + Question->VarStoreInfo.VarOffset, Src, StorageWidth);
|
||||
}
|
||||
//
|
||||
// Check whether question value has been changed.
|
||||
//
|
||||
if (CompareMem (Storage->Buffer + Question->VarStoreInfo.VarOffset, Storage->EditBuffer + Question->VarStoreInfo.VarOffset, StorageWidth) != 0) {
|
||||
Question->ValueChanged = TRUE;
|
||||
} else {
|
||||
Question->ValueChanged = FALSE;
|
||||
}
|
||||
} else {
|
||||
if (IsString) {
|
||||
//
|
||||
@@ -1831,14 +1823,6 @@ SetQuestionValue (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Check whether question value has been changed.
|
||||
//
|
||||
if (StrCmp (Node->Value, Node->EditValue) != 0) {
|
||||
Question->ValueChanged = TRUE;
|
||||
} else {
|
||||
Question->ValueChanged = FALSE;
|
||||
}
|
||||
}
|
||||
} else if (SetValueTo == GetSetValueWithHiiDriver) {
|
||||
//
|
||||
@@ -3453,6 +3437,8 @@ IsQuestionValueChanged (
|
||||
FreePool (BackUpBuffer);
|
||||
}
|
||||
|
||||
Question->ValueChanged = ValueChanged;
|
||||
|
||||
return ValueChanged;
|
||||
}
|
||||
|
||||
@@ -3534,11 +3520,6 @@ LoadFormConfig (
|
||||
Status = ProcessCallBackFunction(Selection, FormSet, Form, Question, EFI_BROWSER_ACTION_RETRIEVE, TRUE);
|
||||
}
|
||||
|
||||
//
|
||||
// Update Question Value changed flag.
|
||||
//
|
||||
Question->ValueChanged = IsQuestionValueChanged(FormSet, Form, Question, GetSetValueWithBuffer);
|
||||
|
||||
Link = GetNextNode (&Form->StatementListHead, Link);
|
||||
}
|
||||
|
||||
@@ -4174,6 +4155,94 @@ LoadStorage (
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Get Value changed status from old question.
|
||||
|
||||
@param NewFormSet FormSet data structure.
|
||||
@param OldQuestion Old question which has value changed.
|
||||
|
||||
**/
|
||||
VOID
|
||||
SyncStatusForQuestion (
|
||||
IN OUT FORM_BROWSER_FORMSET *NewFormSet,
|
||||
IN FORM_BROWSER_STATEMENT *OldQuestion
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *Link;
|
||||
LIST_ENTRY *QuestionLink;
|
||||
FORM_BROWSER_FORM *Form;
|
||||
FORM_BROWSER_STATEMENT *Question;
|
||||
|
||||
//
|
||||
// For each form in one formset.
|
||||
//
|
||||
Link = GetFirstNode (&NewFormSet->FormListHead);
|
||||
while (!IsNull (&NewFormSet->FormListHead, Link)) {
|
||||
Form = FORM_BROWSER_FORM_FROM_LINK (Link);
|
||||
Link = GetNextNode (&NewFormSet->FormListHead, Link);
|
||||
|
||||
//
|
||||
// for each question in one form.
|
||||
//
|
||||
QuestionLink = GetFirstNode (&Form->StatementListHead);
|
||||
while (!IsNull (&Form->StatementListHead, QuestionLink)) {
|
||||
Question = FORM_BROWSER_STATEMENT_FROM_LINK (QuestionLink);
|
||||
QuestionLink = GetNextNode (&Form->StatementListHead, QuestionLink);
|
||||
|
||||
if (Question->QuestionId == OldQuestion->QuestionId) {
|
||||
Question->ValueChanged = TRUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Get Value changed status from old formset.
|
||||
|
||||
@param NewFormSet FormSet data structure.
|
||||
@param OldFormSet FormSet data structure.
|
||||
|
||||
**/
|
||||
VOID
|
||||
SyncStatusForFormSet (
|
||||
IN OUT FORM_BROWSER_FORMSET *NewFormSet,
|
||||
IN FORM_BROWSER_FORMSET *OldFormSet
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *Link;
|
||||
LIST_ENTRY *QuestionLink;
|
||||
FORM_BROWSER_FORM *Form;
|
||||
FORM_BROWSER_STATEMENT *Question;
|
||||
|
||||
//
|
||||
// For each form in one formset.
|
||||
//
|
||||
Link = GetFirstNode (&OldFormSet->FormListHead);
|
||||
while (!IsNull (&OldFormSet->FormListHead, Link)) {
|
||||
Form = FORM_BROWSER_FORM_FROM_LINK (Link);
|
||||
Link = GetNextNode (&OldFormSet->FormListHead, Link);
|
||||
|
||||
//
|
||||
// for each question in one form.
|
||||
//
|
||||
QuestionLink = GetFirstNode (&Form->StatementListHead);
|
||||
while (!IsNull (&Form->StatementListHead, QuestionLink)) {
|
||||
Question = FORM_BROWSER_STATEMENT_FROM_LINK (QuestionLink);
|
||||
QuestionLink = GetNextNode (&Form->StatementListHead, QuestionLink);
|
||||
|
||||
if (!Question->ValueChanged) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Find the same question in new formset and update the value changed flag.
|
||||
//
|
||||
SyncStatusForQuestion (NewFormSet, Question);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Get current setting of Questions.
|
||||
|
||||
@@ -4195,6 +4264,7 @@ InitializeCurrentSetting (
|
||||
//
|
||||
OldFormSet = GetFormSetFromHiiHandle (FormSet->HiiHandle);
|
||||
if (OldFormSet != NULL) {
|
||||
SyncStatusForFormSet (FormSet, OldFormSet);
|
||||
RemoveEntryList (&OldFormSet->Link);
|
||||
DestroyFormSet (OldFormSet);
|
||||
}
|
||||
@@ -5000,6 +5070,7 @@ ExecuteAction (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
UpdateStatementStatus (FormSet, Form, gBrowserSettingScope);
|
||||
}
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user