X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellDebug1CommandsLib%2FHexEdit%2FBufferImage.c;h=bfedf58d78a2dabe202138f960980c57b3a9cfd0;hb=e755a4ca10aad316c3620223206d63982793b26c;hp=57c4a9c739f29e0a17dd637f1c5977f007a51a2e;hpb=e0c2cc6f8975adde2c8605ae7fd76237bbcc7539;p=mirror_edk2.git diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c index 57c4a9c739..bfedf58d78 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c @@ -752,7 +752,6 @@ HBufferImageRefresh ( UINTN StartRow; UINTN EndRow; UINTN FStartRow; - UINTN FEndRow; UINTN Tmp; Orig = HMainEditor.ColorAttributes; @@ -821,7 +820,6 @@ HBufferImageRefresh ( } FStartRow = StartRow; - FEndRow = EndRow; StartRow = 2 + StartRow - HBufferImage.LowVisibleRow; EndRow = 2 + EndRow - HBufferImage.LowVisibleRow; @@ -832,7 +830,7 @@ HBufferImageRefresh ( // FStartRow = HBufferImage.LowVisibleRow; StartRow = 2; - EndRow = (HMainEditor.ScreenSize.Row - 4); + EndRow = (HMainEditor.ScreenSize.Row - 1); } // // no line @@ -1404,7 +1402,7 @@ HUnderCurrentScreen ( IN UINTN FileRow ) { - if (FileRow > HBufferImage.LowVisibleRow + (HMainEditor.ScreenSize.Row - 5) - 1) { + if (FileRow > HBufferImage.LowVisibleRow + (HMainEditor.ScreenSize.Row - 2) - 1) { return TRUE; } @@ -1712,8 +1710,8 @@ HBufferImagePageDown ( // // has next page // - if (HBufferImage.NumLines >= FRow + (HMainEditor.ScreenSize.Row - 5)) { - Gap = (HMainEditor.ScreenSize.Row - 5); + if (HBufferImage.NumLines >= FRow + (HMainEditor.ScreenSize.Row - 2)) { + Gap = (HMainEditor.ScreenSize.Row - 2); } else { // // MOVE CURSOR TO LAST LINE @@ -1750,22 +1748,19 @@ HBufferImagePageUp ( VOID ) { - HEFI_EDITOR_LINE *Line; UINTN FRow; UINTN FCol; UINTN Gap; INTN Retreat; - Line = HBufferImage.CurrentLine; - FRow = HBufferImage.BufferPosition.Row; FCol = HBufferImage.BufferPosition.Column; // // has previous page // - if (FRow > (HMainEditor.ScreenSize.Row - 5)) { - Gap = (HMainEditor.ScreenSize.Row - 5); + if (FRow > (HMainEditor.ScreenSize.Row - 2)) { + Gap = (HMainEditor.ScreenSize.Row - 2); } else { // // the first line of file will displayed on the first line of screen @@ -1776,11 +1771,6 @@ HBufferImagePageUp ( Retreat = Gap; Retreat = -Retreat; - // - // get correct line - // - Line = HMoveLine (Retreat); - FRow -= Gap; HBufferImageMovePosition (FRow, FCol, HBufferImage.HighBits); @@ -1798,13 +1788,10 @@ HBufferImageHome ( VOID ) { - HEFI_EDITOR_LINE *Line; UINTN FRow; UINTN FCol; BOOLEAN HighBits; - Line = HBufferImage.CurrentLine; - // // curosr will at the high bit // @@ -1918,7 +1905,6 @@ HBufferImageDeleteCharacterFromBuffer ( HEFI_EDITOR_LINE *Line; LIST_ENTRY *Link; - UINTN StartRow; UINTN OldFCol; UINTN OldFRow; @@ -1928,11 +1914,6 @@ HBufferImageDeleteCharacterFromBuffer ( EFI_STATUS Status; - // - // get the line that start position is at - // - StartRow = Pos / 0x10; - Size = HBufferImageGetTotalSize (); if (Size < Count) { @@ -2054,7 +2035,6 @@ HBufferImageAddCharacterToBuffer ( HEFI_EDITOR_LINE *Line; LIST_ENTRY *Link; - UINTN StartRow; UINTN OldFCol; UINTN OldFRow; @@ -2062,11 +2042,6 @@ HBufferImageAddCharacterToBuffer ( UINTN NewPos; - // - // get the line that start position is at - // - StartRow = Pos / 0x10; - Size = HBufferImageGetTotalSize (); // @@ -2392,12 +2367,12 @@ HBufferImageAdjustMousePosition ( // check whether new mouse row position is beyond screen // if not, adjust it // - if (TempY >= 2 && TempY <= (HMainEditor.ScreenSize.Row - 4)) { + if (TempY >= 2 && TempY <= (HMainEditor.ScreenSize.Row - 1)) { HBufferImage.MousePosition.Row = TempY; } else if (TempY < 2) { HBufferImage.MousePosition.Row = 2; - } else if (TempY > (HMainEditor.ScreenSize.Row - 4)) { - HBufferImage.MousePosition.Row = (HMainEditor.ScreenSize.Row - 4); + } else if (TempY > (HMainEditor.ScreenSize.Row - 1)) { + HBufferImage.MousePosition.Row = (HMainEditor.ScreenSize.Row - 1); } }