Width -= SUBTITLE_INDENT;\r
}\r
\r
- return Width;\r
+ return (UINT16) (Width - LEFT_SKIPPED_COLUMNS);\r
}\r
\r
/**\r
Row = LocalScreen.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT + SCROLL_ARROW_HEIGHT;\r
}\r
\r
- Col = LocalScreen.LeftColumn;\r
+ Col = LocalScreen.LeftColumn + LEFT_SKIPPED_COLUMNS;\r
BottomRow = LocalScreen.BottomRow - STATUS_BAR_HEIGHT - FOOTER_HEIGHT - SCROLL_ARROW_HEIGHT - 1;\r
\r
Selection->TopRow = TopRow;\r
UpArrow = FALSE;\r
Row = TopRow;\r
\r
- Temp = SkipValue;\r
- Temp2 = SkipValue;\r
+ Temp = (UINTN) SkipValue;\r
+ Temp2 = (UINTN) SkipValue;\r
\r
ClearLines (\r
LocalScreen.LeftColumn,\r
Temp = 0;\r
Row = OriginalRow;\r
\r
- gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);\r
Status = ProcessOptions (Selection, MenuOption, FALSE, &OptionString);\r
if (EFI_ERROR (Status)) {\r
//\r
Row = OriginalRow;\r
FreePool (StringPtr);\r
}\r
+ gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);\r
\r
//\r
// Need to handle the bottom of the display\r
//\r
// Don't print anything if it is a NULL help token\r
//\r
+ ASSERT(MenuOption != NULL);\r
if (MenuOption->ThisTag->Help == 0) {\r
StringPtr = L"\0";\r
} else {\r
//\r
case '+':\r
case '-':\r
+ //\r
+ // If the screen has no menu items, and the user didn't select UiReset\r
+ // ignore the selection and go back to reading keys.\r
+ //\r
+ if(IsListEmpty (&gMenuOption)) {\r
+ ControlFlag = CfReadKey;\r
+ break;\r
+ }\r
+\r
+ ASSERT(MenuOption != NULL);\r
Statement = MenuOption->ThisTag;\r
if ((Statement->Operand == EFI_IFR_DATE_OP)\r
|| (Statement->Operand == EFI_IFR_TIME_OP)\r
\r
case ' ':\r
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) != FORMSET_CLASS_FRONT_PAGE) {\r
+ //\r
+ // If the screen has no menu items, and the user didn't select UiReset\r
+ // ignore the selection and go back to reading keys.\r
+ //\r
+ if(IsListEmpty (&gMenuOption)) {\r
+ ControlFlag = CfReadKey;\r
+ break;\r
+ }\r
+ \r
+ ASSERT(MenuOption != NULL);\r
if (MenuOption->ThisTag->Operand == EFI_IFR_CHECKBOX_OP && !MenuOption->GrayOut) {\r
ScreenOperation = UiSelect;\r
}\r
case CfUiSelect:\r
ControlFlag = CfCheckSelection;\r
\r
+ ASSERT(MenuOption != NULL);\r
Statement = MenuOption->ThisTag;\r
if ((Statement->Operand == EFI_IFR_TEXT_OP) ||\r
(Statement->Operand == EFI_IFR_DATE_OP) ||\r
}\r
BufferSize = StrLen (StringPtr) / 2;\r
DevicePath = AllocatePool (BufferSize);\r
+ ASSERT (DevicePath != NULL);\r
\r
//\r
// Convert from Device Path String to DevicePath Buffer in the reverse order.\r
\r
case CfUiLeft:\r
ControlFlag = CfCheckSelection;\r
+ ASSERT(MenuOption != NULL);\r
if ((MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP) || (MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP)) {\r
if (MenuOption->Sequence != 0) {\r
//\r
// In the middle or tail of the Date/Time op-code set, go left.\r
//\r
+ ASSERT(NewPos != NULL);\r
NewPos = NewPos->BackLink;\r
}\r
}\r
\r
case CfUiRight:\r
ControlFlag = CfCheckSelection;\r
+ ASSERT(MenuOption != NULL);\r
if ((MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP) || (MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP)) {\r
if (MenuOption->Sequence != 2) {\r
//\r
// In the middle or tail of the Date/Time op-code set, go left.\r
//\r
+ ASSERT(NewPos != NULL);\r
NewPos = NewPos->ForwardLink;\r
}\r
}\r
\r
SavedListEntry = TopOfScreen;\r
\r
+ ASSERT(NewPos != NULL);\r
if (NewPos->BackLink != &gMenuOption) {\r
NewLine = TRUE;\r
//\r
NewPos = NewPos->BackLink;\r
}\r
\r
+ Difference = MoveToNextStatement (TRUE, &NewPos);\r
PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos);\r
DistanceValue = PreviousMenuOption->Skip;\r
\r
//\r
DistanceValue += AdjustDateAndTimePosition (TRUE, &NewPos);\r
\r
- //\r
- // Check the previous menu entry to see if it was a zero-length advance. If it was,\r
- // don't worry about a redraw.\r
- //\r
- if ((INTN) MenuOption->Row - (INTN) DistanceValue < (INTN) TopRow) {\r
- Repaint = TRUE;\r
- TopOfScreen = NewPos;\r
- }\r
-\r
- Difference = MoveToNextStatement (TRUE, &NewPos);\r
- PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos);\r
- DistanceValue += PreviousMenuOption->Skip;\r
-\r
- if ((INTN) MenuOption->Row - (INTN) DistanceValue < (INTN) TopRow) {\r
- if (Difference > 0) {\r
- //\r
- // Previous focus MenuOption is above the TopOfScreen, so we need to scroll\r
- //\r
- TopOfScreen = NewPos;\r
- Repaint = TRUE;\r
- SkipValue = 0;\r
- OldSkipValue = 0;\r
- }\r
- }\r
if (Difference < 0) {\r
//\r
// We want to goto previous MenuOption, but finally we go down.\r
TopOfScreen = gMenuOption.ForwardLink;\r
Repaint = TRUE;\r
}\r
+ } else if ((INTN) MenuOption->Row - (INTN) DistanceValue - Difference < (INTN) TopRow) {\r
+ //\r
+ // Previous focus MenuOption is above the TopOfScreen, so we need to scroll\r
+ //\r
+ TopOfScreen = NewPos;\r
+ Repaint = TRUE;\r
+ SkipValue = 0;\r
+ OldSkipValue = 0;\r
}\r
\r
//\r
case CfUiPageUp:\r
ControlFlag = CfCheckSelection;\r
\r
+ ASSERT(NewPos != NULL);\r
if (NewPos->BackLink == &gMenuOption) {\r
NewLine = FALSE;\r
Repaint = FALSE;\r
case CfUiPageDown:\r
ControlFlag = CfCheckSelection;\r
\r
+ ASSERT (NewPos != NULL);\r
if (NewPos->ForwardLink == &gMenuOption) {\r
NewLine = FALSE;\r
Repaint = FALSE;\r
MenuOption = MENU_OPTION_FROM_LINK (NewPos);\r
NewLine = TRUE;\r
NewPos = NewPos->ForwardLink;\r
- NextMenuOption = MENU_OPTION_FROM_LINK (NewPos);\r
\r
- DistanceValue += NextMenuOption->Skip;\r
DistanceValue += MoveToNextStatement (FALSE, &NewPos);\r
+ NextMenuOption = MENU_OPTION_FROM_LINK (NewPos);\r
+\r
//\r
// An option might be multi-line, so we need to reflect that data in the overall skip value\r
//\r
- UpdateOptionSkipLines (Selection, NextMenuOption, &OptionString, SkipValue);\r
+ UpdateOptionSkipLines (Selection, NextMenuOption, &OptionString, (UINTN) SkipValue);\r
+ DistanceValue += NextMenuOption->Skip;\r
\r
Temp = MenuOption->Row + MenuOption->Skip + DistanceValue - 1;\r
if ((MenuOption->Row + MenuOption->Skip == BottomRow + 1) &&\r
//\r
// If we have a remainder, skip that many more op-codes until we drain the remainder\r
//\r
- for (;\r
- Difference >= (INTN) SavedMenuOption->Skip;\r
- Difference = Difference - (INTN) SavedMenuOption->Skip\r
- ) {\r
+ while (Difference >= (INTN) SavedMenuOption->Skip) {\r
//\r
// Since the Difference is greater than or equal to this op-code's skip value, skip it\r
//\r
+ Difference = Difference - (INTN) SavedMenuOption->Skip;\r
TopOfScreen = TopOfScreen->ForwardLink;\r
SavedMenuOption = MENU_OPTION_FROM_LINK (TopOfScreen);\r
- if (Difference < (INTN) SavedMenuOption->Skip) {\r
- Difference = SavedMenuOption->Skip - Difference - 1;\r
- break;\r
- } else {\r
- if (Difference == (INTN) SavedMenuOption->Skip) {\r
- TopOfScreen = TopOfScreen->ForwardLink;\r
- SavedMenuOption = MENU_OPTION_FROM_LINK (TopOfScreen);\r
- Difference = SavedMenuOption->Skip - Difference;\r
- break;\r
- }\r
- }\r
}\r
//\r
// Since we will act on this op-code in the next routine, and increment the\r
} else {\r
SkipValue++;\r
}\r
+ } else if (SavedMenuOption->Skip == 1) {\r
+ SkipValue = 0;\r
} else {\r
SkipValue = 0;\r
TopOfScreen = TopOfScreen->ForwardLink;\r
Status = SubmitForm (Selection->FormSet, Selection->Form);\r
\r
if (!EFI_ERROR (Status)) {\r
+ ASSERT(MenuOption != NULL);\r
UpdateStatusBar (INPUT_ERROR, MenuOption->ThisTag->QuestionFlags, FALSE);\r
UpdateStatusBar (NV_UPDATE_REQUIRED, MenuOption->ThisTag->QuestionFlags, FALSE);\r
} else {\r