From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.9877.1632806821231265354 for ; Mon, 27 Sep 2021 22:27:02 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 28 Sep 2021 13:26:57 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Wang, Jian J'" , "'Ni, Ray'" References: <16A89C34DEA6347B.26412@groups.io> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIFYzXSBNZGVNb2R1bGVQa2cvQm9vdE1hbmFnZXJNZW51QXBwOiBMaW1pdCBzdHJpbmcgZHJhd2luZyB3aXRoaW4gb25lIGxpbmU=?= Date: Tue, 28 Sep 2021 13:26:58 +0800 Message-ID: <00d201d7b429$75911460$60b33d20$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJVFjKRiHX3v8vKSlEJiIOc/+bK5QK8OlPtqqhElbA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn I am ok for this change. Reviewed-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED Gao, Zhichao > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA9=D4=C228=C8=D5 13:18 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; Gao, Zhichao > =B3=AD=CB=CD: Wang, Jian J ; Liming Gao > ; Ni, Ray > =D6=F7=CC=E2: Re: [edk2-devel] [PATCH V3] MdeModulePkg/BootManagerMenuApp= : > Limit string drawing within one line >=20 > Hi Liming/Ray, >=20 > I have updated the commit message and the BZ comments. Do you agree to > merge the code? >=20 > Thanks, > Zhichao >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Gao, > > Zhichao > > Sent: Monday, September 27, 2021 3:10 PM > > To: devel@edk2.groups.io > > Cc: Wang, Jian J ; Liming Gao > > ; Ni, Ray > > Subject: [edk2-devel] [PATCH V3] MdeModulePkg/BootManagerMenuApp: > > Limit string drawing within one line > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3590 > > > > Limit the draw box always within the screen's column and row. > > Limit the string drawing within one line.For the incompleted string the last 3 > > characters in one line wouldbe replaced with "...". > > > > Cc: Jian J Wang > > Cc: Liming Gao > > Cc: Ray Ni > > Signed-off-by: Zhichao Gao Reviewed-by: Ray Ni > > ---V2:Drop the change in UefiBootManagerLib in > V1.Add > > the limitation in BootManagerMenuApp instead.V3:Update the commit > > message only. > > .../BootManagerMenuApp/BootManagerMenu.c | 72 > > ++++++++++++++++++- > > 1 file changed, 69 insertions(+), 3 deletions(-) > > > > diff --git > > a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > > c > > b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > > c > > index 9e729074ec..d4bdeba073 100644 > > --- > > a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > > c > > +++ > > b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > > c > > @@ -1,7 +1,7 @@ > > /** @file The application to show the Boot Manager Menu. -Copyright > (c) > > 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - > > 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: > > BSD-2-Clause-Patent **/@@ -45,9 +45,56 @@ PrintStringAt ( > > IN CHAR16 *String ) {+ UINTN ScreenWidth;+ > UINTN > > ScreenRows;+ CHAR16 *TurncateString;+ EFI_STATUS > Status;+ UINTN > > ShowingLength; gST->ConOut->SetCursorPosition (gST->ConOut, > Column, > > Row);- return Print (L"%s", String);++ gST->ConOut->QueryMode (+ > > gST->ConOut,+ gST->ConOut->Mode->Mode,+ > > &ScreenWidth,+ > &ScreenRows+ );++ if (Column > > > (ScreenWidth - 1) || Row > (ScreenRows - 1)) {+ return 0;+ }++ if > ((StrLen > > (String) + Column) > (ScreenWidth - 1)) {+ //+ // | - > ScreenWidth - |+ > > // ...Column.....................+ // TurncateString length should leave one > > character for draw box and+ // require one character for string end.= + > //+ > > ShowingLength =3D ScreenWidth - Column - 1;+ TurncateString =3D > AllocatePool > > ((ShowingLength + 1) * sizeof (CHAR16));++ if (TurncateString =3D=3D NULL) > {+ > > return 0;+ }++ Status =3D StrnCpyS (TurncateString, ShowingLength= + > 1, > > String, ShowingLength - 3);++ if (EFI_ERROR (Status)) {+ FreePool > > (TurncateString);+ return 0;+ }++ *(TurncateString + > ShowingLength - 3) > > =3D L'.';+ *(TurncateString + ShowingLength - 2) =3D L'.';+ > *(TurncateString + > > ShowingLength - 1) =3D L'.';+ *(TurncateString + ShowingLength) = =3D > L'\0';+ > > ShowingLength =3D Print (L"%s", TurncateString);+ FreePool > > (TurncateString);+ return ShowingLength;+ } else {+ return Print > (L"%s", > > String);+ } } /**@@ -68,7 +115,22 @@ PrintCharAt ( > > CHAR16 Character ) {+ UINTN ScreenWidth;+ > UINTN > > ScreenRows;+ gST->ConOut->SetCursorPosition (gST->ConOut, Column, > > Row);++ gST->ConOut->QueryMode (+ > gST->ConOut,+ gST- > > >ConOut->Mode->Mode,+ &ScreenWidth,+ > > &ScreenRows+ );++ if (Column > (ScreenWidth - 1) || > Row > > > (ScreenRows - 1)) {+ return 0;+ }+ return Print (L"%c", Character); } > @@ - > > 193,7 +255,11 @@ InitializeBootMenuScreen ( > > MaxPrintRows =3D Row - 6; UnSelectableItmes =3D > TITLE_TOKEN_COUNT + 2 + > > HELP_TOKEN_COUNT + 2;- BootMenuData->MenuScreen.Width =3D > > MaxStrWidth + 8;+ if (MaxStrWidth + 8 > Column) {+ BootMenuData- > > >MenuScreen.Width =3D Column;+ } else {+ BootMenuData- > > >MenuScreen.Width =3D MaxStrWidth + 8;+ } if > (BootMenuData->ItemCount > > + UnSelectableItmes > MaxPrintRows) { BootMenuData- > > >MenuScreen.Height =3D MaxPrintRows; BootMenuData- > > >ScrollBarControl.HasScrollBar =3D TRUE;-- > > 2.31.1.windows.1 > > > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D > > Groups.io Links: You receive all messages sent to this group. > > View/Reply Online (#81153): > https://edk2.groups.io/g/devel/message/81153 > > Mute This Topic: https://groups.io/mt/85895022/1768756 > > Group Owner: devel+owner@edk2.groups.io > > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [zhichao.gao@intel.com] > > -=3D-=3D-=3D-=3D-=3D-=3D > > >=20 >=20 >=20 >=20 >=20