mirror of https://github.com/acidanthera/audk.git
Keep consistent about the return value between the caller and callee.
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@15032 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
3e108dfd7d
commit
27bace9b3e
|
@ -27,6 +27,7 @@ typedef struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL EFI_FORM_BROWSER_EXTENSION
|
||||||
#define BROWSER_NO_CHANGES 0
|
#define BROWSER_NO_CHANGES 0
|
||||||
#define BROWSER_SAVE_CHANGES 1
|
#define BROWSER_SAVE_CHANGES 1
|
||||||
#define BROWSER_DISCARD_CHANGES 2
|
#define BROWSER_DISCARD_CHANGES 2
|
||||||
|
#define BROWSER_KEEP_CURRENT 3
|
||||||
|
|
||||||
//
|
//
|
||||||
// Browser actions. They can be cominbed together.
|
// Browser actions. They can be cominbed together.
|
||||||
|
@ -126,6 +127,7 @@ VOID
|
||||||
@retval BROWSER_NO_CHANGES No browser data is changed.
|
@retval BROWSER_NO_CHANGES No browser data is changed.
|
||||||
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
|
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
|
||||||
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
|
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
|
||||||
|
@retval BROWSER_KEEP_CURRENT Browser keep current changes.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
typedef
|
typedef
|
||||||
|
|
|
@ -4902,21 +4902,27 @@ IsBrowserDataModified (
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
FORM_BROWSER_FORMSET *FormSet;
|
FORM_BROWSER_FORMSET *FormSet;
|
||||||
|
|
||||||
if (gCurrentSelection == NULL) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (gBrowserSettingScope) {
|
switch (gBrowserSettingScope) {
|
||||||
case FormLevel:
|
case FormLevel:
|
||||||
|
if (gCurrentSelection == NULL) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
return IsNvUpdateRequiredForForm (gCurrentSelection->Form);
|
return IsNvUpdateRequiredForForm (gCurrentSelection->Form);
|
||||||
|
|
||||||
case FormSetLevel:
|
case FormSetLevel:
|
||||||
|
if (gCurrentSelection == NULL) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
return IsNvUpdateRequiredForFormSet (gCurrentSelection->FormSet);
|
return IsNvUpdateRequiredForFormSet (gCurrentSelection->FormSet);
|
||||||
|
|
||||||
case SystemLevel:
|
case SystemLevel:
|
||||||
Link = GetFirstNode (&gBrowserFormSetList);
|
Link = GetFirstNode (&gBrowserFormSetList);
|
||||||
while (!IsNull (&gBrowserFormSetList, Link)) {
|
while (!IsNull (&gBrowserFormSetList, Link)) {
|
||||||
FormSet = FORM_BROWSER_FORMSET_FROM_LINK (Link);
|
FormSet = FORM_BROWSER_FORMSET_FROM_LINK (Link);
|
||||||
|
if (!ValidateFormSet(FormSet)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (IsNvUpdateRequiredForFormSet (FormSet)) {
|
if (IsNvUpdateRequiredForFormSet (FormSet)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -4946,19 +4952,27 @@ ExecuteAction (
|
||||||
IN UINT16 DefaultId
|
IN UINT16 DefaultId
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
FORM_BROWSER_FORMSET *FormSet;
|
||||||
|
FORM_BROWSER_FORM *Form;
|
||||||
|
|
||||||
if (gCurrentSelection == NULL) {
|
if (gBrowserSettingScope < SystemLevel && gCurrentSelection == NULL) {
|
||||||
return EFI_NOT_READY;
|
return EFI_NOT_READY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
|
FormSet = NULL;
|
||||||
|
Form = NULL;
|
||||||
|
if (gBrowserSettingScope < SystemLevel) {
|
||||||
|
FormSet = gCurrentSelection->FormSet;
|
||||||
|
Form = gCurrentSelection->Form;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Executet the discard action.
|
// Executet the discard action.
|
||||||
//
|
//
|
||||||
if ((Action & BROWSER_ACTION_DISCARD) != 0) {
|
if ((Action & BROWSER_ACTION_DISCARD) != 0) {
|
||||||
Status = DiscardForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
|
Status = DiscardForm (FormSet, Form, gBrowserSettingScope);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -4968,7 +4982,7 @@ ExecuteAction (
|
||||||
// Executet the difault action.
|
// Executet the difault action.
|
||||||
//
|
//
|
||||||
if ((Action & BROWSER_ACTION_DEFAULT) != 0) {
|
if ((Action & BROWSER_ACTION_DEFAULT) != 0) {
|
||||||
Status = ExtractDefault (gCurrentSelection->FormSet, gCurrentSelection->Form, DefaultId, gBrowserSettingScope, GetDefaultForAll, NULL, FALSE);
|
Status = ExtractDefault (FormSet, Form, DefaultId, gBrowserSettingScope, GetDefaultForAll, NULL, FALSE);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -4978,7 +4992,7 @@ ExecuteAction (
|
||||||
// Executet the submit action.
|
// Executet the submit action.
|
||||||
//
|
//
|
||||||
if ((Action & BROWSER_ACTION_SUBMIT) != 0) {
|
if ((Action & BROWSER_ACTION_SUBMIT) != 0) {
|
||||||
Status = SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
|
Status = SubmitForm (FormSet, Form, gBrowserSettingScope);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -4995,7 +5009,7 @@ ExecuteAction (
|
||||||
// Executet the exit action.
|
// Executet the exit action.
|
||||||
//
|
//
|
||||||
if ((Action & BROWSER_ACTION_EXIT) != 0) {
|
if ((Action & BROWSER_ACTION_EXIT) != 0) {
|
||||||
DiscardForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
|
DiscardForm (FormSet, Form, gBrowserSettingScope);
|
||||||
if (gBrowserSettingScope == SystemLevel) {
|
if (gBrowserSettingScope == SystemLevel) {
|
||||||
if (ExitHandlerFunction != NULL) {
|
if (ExitHandlerFunction != NULL) {
|
||||||
ExitHandlerFunction ();
|
ExitHandlerFunction ();
|
||||||
|
@ -5015,6 +5029,7 @@ ExecuteAction (
|
||||||
@retval BROWSER_NO_CHANGES No browser data is changed.
|
@retval BROWSER_NO_CHANGES No browser data is changed.
|
||||||
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
|
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
|
||||||
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
|
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
|
||||||
|
@retval BROWSER_KEEP_CURRENT Browser keep current changes.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
UINT32
|
||||||
|
@ -5027,6 +5042,7 @@ SaveReminder (
|
||||||
FORM_BROWSER_FORMSET *FormSet;
|
FORM_BROWSER_FORMSET *FormSet;
|
||||||
BOOLEAN IsDataChanged;
|
BOOLEAN IsDataChanged;
|
||||||
UINT32 DataSavedAction;
|
UINT32 DataSavedAction;
|
||||||
|
UINT32 ConfirmRet;
|
||||||
|
|
||||||
DataSavedAction = BROWSER_NO_CHANGES;
|
DataSavedAction = BROWSER_NO_CHANGES;
|
||||||
IsDataChanged = FALSE;
|
IsDataChanged = FALSE;
|
||||||
|
@ -5054,13 +5070,18 @@ SaveReminder (
|
||||||
// If data is changed, prompt user to save or discard it.
|
// If data is changed, prompt user to save or discard it.
|
||||||
//
|
//
|
||||||
do {
|
do {
|
||||||
DataSavedAction = (UINT32) mFormDisplay->ConfirmDataChange();
|
ConfirmRet = (UINT32) mFormDisplay->ConfirmDataChange();
|
||||||
|
|
||||||
if (DataSavedAction == BROWSER_SAVE_CHANGES) {
|
if (ConfirmRet == BROWSER_ACTION_SUBMIT) {
|
||||||
SubmitForm (NULL, NULL, SystemLevel);
|
SubmitForm (NULL, NULL, SystemLevel);
|
||||||
|
DataSavedAction = BROWSER_SAVE_CHANGES;
|
||||||
break;
|
break;
|
||||||
} else if (DataSavedAction == BROWSER_DISCARD_CHANGES) {
|
} else if (ConfirmRet == BROWSER_ACTION_DISCARD) {
|
||||||
DiscardForm (NULL, NULL, SystemLevel);
|
DiscardForm (NULL, NULL, SystemLevel);
|
||||||
|
DataSavedAction = BROWSER_DISCARD_CHANGES;
|
||||||
|
break;
|
||||||
|
} else if (ConfirmRet == BROWSER_ACTION_NONE) {
|
||||||
|
DataSavedAction = BROWSER_KEEP_CURRENT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
|
@ -1327,6 +1327,7 @@ ExecuteAction (
|
||||||
@retval BROWSER_NO_CHANGES No browser data is changed.
|
@retval BROWSER_NO_CHANGES No browser data is changed.
|
||||||
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
|
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
|
||||||
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
|
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
|
||||||
|
@retval BROWSER_KEEP_CURRENT Browser keep current changes.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
UINT32
|
||||||
|
|
Loading…
Reference in New Issue