fix the issue when passing a L"" string to PrintXY.

1. According to the value of RowInfoArraySize to get the actual number of printed line.
2. If RowInfoArraySize equates 0, then it means nothing is printed.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8464 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian 2009-06-04 13:50:14 +00:00
parent c8c44377af
commit 63fffe4e72

View File

@ -347,6 +347,9 @@ InternalPrintGraphic (
EFI_UGA_DRAW_PROTOCOL *UgaDraw; EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Sto; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Sto;
EFI_HANDLE ConsoleHandle; EFI_HANDLE ConsoleHandle;
UINTN Width;
UINTN Height;
UINTN Delta;
HorizontalResolution = 0; HorizontalResolution = 0;
VerticalResolution = 0; VerticalResolution = 0;
@ -485,6 +488,15 @@ InternalPrintGraphic (
// //
ASSERT (RowInfoArraySize <= 1); ASSERT (RowInfoArraySize <= 1);
if (RowInfoArraySize != 0) {
Width = RowInfoArray[0].LineWidth;
Height = RowInfoArray[0].LineHeight;
Delta = Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
} else {
Width = 0;
Height = 0;
Delta = 0;
}
Status = UgaDraw->Blt ( Status = UgaDraw->Blt (
UgaDraw, UgaDraw,
(EFI_UGA_PIXEL *) Blt->Image.Bitmap, (EFI_UGA_PIXEL *) Blt->Image.Bitmap,
@ -493,9 +505,9 @@ InternalPrintGraphic (
PointY, PointY,
PointX, PointX,
PointY, PointY,
RowInfoArray[0].LineWidth, Width,
RowInfoArray[0].LineHeight, Height,
Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) Delta
); );
} else { } else {
goto Error; goto Error;
@ -507,7 +519,11 @@ InternalPrintGraphic (
// //
// Calculate the number of actual printed characters // Calculate the number of actual printed characters
// //
if (RowInfoArraySize != 0) {
PrintNum = RowInfoArray[0].EndIndex - RowInfoArray[0].StartIndex + 1; PrintNum = RowInfoArray[0].EndIndex - RowInfoArray[0].StartIndex + 1;
} else {
PrintNum = 0;
}
FreePool (RowInfoArray); FreePool (RowInfoArray);
FreePool (Blt); FreePool (Blt);