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
This commit is contained in:
ydong10
2012-04-23 10:26:04 +00:00
parent 389c8779e8
commit 5ea466a551
2 changed files with 23 additions and 191 deletions

View File

@@ -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,