diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-04-23 10:26:04 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-04-23 10:26:04 +0000 |
commit | 5ea466a55102b7a60fa9b771e750398e69e33f45 (patch) | |
tree | c91fd26cb5460d9c1265fbcece6e9615fe9d43ac /MdeModulePkg/Universal/SetupBrowserDxe/Ui.c | |
parent | 389c8779e866c4b624e60f50beaa7cf7d74a1b03 (diff) | |
download | edk2-platforms-5ea466a55102b7a60fa9b771e750398e69e33f45.tar.xz |
Refine the code to have same function to process the string info. Also update the logic to process special char.
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13205 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Ui.c')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Ui.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c index 82a82e5115..6999f625db 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c @@ -1308,6 +1308,7 @@ GetWidth ( /**
Will copy LineWidth amount of a string in the OutputString buffer and return the
number of CHAR16 characters that were copied into the OutputString buffer.
+ In the code, it deals \r,\n,\r\n same as \n\r, also it not process the \r or \g.
@param InputString String description for this option.
@param LineWidth Width of the desired string to extract in CHAR16
@@ -1353,9 +1354,9 @@ GetLineByWidth ( }
//
- // Fast-forward the string and see if there is a carriage-return in the string
+ // Fast-forward the string and see if there is a carriage-return or linefeed in the string
//
- for (; (InputString[*Index + Count2] != CHAR_CARRIAGE_RETURN) && (Count2 != LineWidth); Count2++)
+ for (; (InputString[*Index + Count2] != CHAR_LINEFEED) && (InputString[*Index + Count2] != CHAR_CARRIAGE_RETURN) && (Count2 != LineWidth); Count2++)
;
//
@@ -1391,10 +1392,10 @@ GetLineByWidth ( CopyMem (*OutputString, &InputString[*Index], LineWidth * 2);
//
- // If currently pointing to a space, increment the index to the first non-space character
+ // If currently pointing to a space or carriage-return or linefeed, increment the index to the first non-space character
//
for (;
- (InputString[*Index + LineWidth] == CHAR_SPACE) || (InputString[*Index + LineWidth] == CHAR_CARRIAGE_RETURN);
+ (InputString[*Index + LineWidth] == CHAR_SPACE) || (InputString[*Index + LineWidth] == CHAR_CARRIAGE_RETURN)|| (InputString[*Index + LineWidth] == CHAR_LINEFEED);
(*Index)++
)
;
@@ -2923,7 +2924,7 @@ UiDisplayMenu ( // Print the help string info.
//
if (!MultiHelpPage) {
- for (Index = 0; Index < RowCount; Index++) {
+ for (Index = 0; Index < HelpLine; Index++) {
PrintStringAt (
LocalScreen.RightColumn - gHelpBlockWidth,
Index + TopRow,
|