Revision: 15898
http://sourceforge.net/p/edk2/code/15898
Author: ydong10
Date: 2014-08-26 07:16:29 +0000 (Tue, 26 Aug 2014)
Log Message:
-----------
The original code does not initialize the global width constants before
creating menu options. That caused an issue when long strings are used in the
first HII form, but only when displayed for the first time.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud [email protected]
Reviewed-by: Eric Dong <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
Modified: trunk/edk2/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
2014-08-26 07:14:38 UTC (rev 15897)
+++ trunk/edk2/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
2014-08-26 07:16:29 UTC (rev 15898)
@@ -2,6 +2,7 @@
Entry and initialization module for the browser.
Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
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
@@ -2125,16 +2126,7 @@
ZeroMem (&Key, sizeof (EFI_INPUT_KEY));
- //
- // Left right
- // |<-.->|<-.........->|<- .........->|<-...........->|
- // Skip Prompt Option Help
- //
- Width = (CHAR16) ((gStatementDimensions.RightColumn -
gStatementDimensions.LeftColumn) / 3);
- gOptionBlockWidth = Width + 1;
- gHelpBlockWidth = (CHAR16) (Width - LEFT_SKIPPED_COLUMNS);
- gPromptBlockWidth = (CHAR16) (gStatementDimensions.RightColumn -
gStatementDimensions.LeftColumn - 2 * Width - 1);
-
+ Width = (UINT16)gOptionBlockWidth - 1;
TopRow = gStatementDimensions.TopRow + SCROLL_ARROW_HEIGHT;
BottomRow = gStatementDimensions.BottomRow - SCROLL_ARROW_HEIGHT - 1;
@@ -3417,14 +3409,27 @@
return EFI_SUCCESS;
}
- ConvertStatementToMenu();
-
Status = DisplayPageFrame (FormData, &gStatementDimensions);
if (EFI_ERROR (Status)) {
return Status;
}
//
+ // Global Widths should be initialized before any MenuOption creation
+ // or the GetWidth() used in UiAddMenuOption() will return incorrect value.
+ //
+ //
+ // Left right
+ // |<-.->|<-.........->|<- .........->|<-...........->|
+ // Skip Prompt Option Help
+ //
+ gOptionBlockWidth = (CHAR16) ((gStatementDimensions.RightColumn -
gStatementDimensions.LeftColumn) / 3) + 1;
+ gHelpBlockWidth = (CHAR16) (gOptionBlockWidth - 1 - LEFT_SKIPPED_COLUMNS);
+ gPromptBlockWidth = (CHAR16) (gStatementDimensions.RightColumn -
gStatementDimensions.LeftColumn - 2 * (gOptionBlockWidth - 1) - 1);
+
+ ConvertStatementToMenu();
+
+ //
// Check whether layout is changed.
//
if (mIsFirstForm
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits