From 66e0d97b10d6b3294003af44eb7def59e260d0de Mon Sep 17 00:00:00 2001 From: Gustavo Carreno Date: Mon, 1 Feb 2021 21:53:17 +0000 Subject: [PATCH] fix: Int64/QWord now good on IntToBin() --- src/application/ljv.application.version.pas | 4 ++-- src/forms/ljv.forms.main.pas | 18 ++++-------------- src/lazJSONViewer.lpi | 2 +- src/lazJSONViewer.res | Bin 139748 -> 139748 bytes 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/application/ljv.application.version.pas b/src/application/ljv.application.version.pas index 796b268..9841b76 100644 --- a/src/application/ljv.application.version.pas +++ b/src/application/ljv.application.version.pas @@ -5,11 +5,11 @@ interface const - cVersion = '0.1.3.25'; + cVersion = '0.1.3.26'; cVersionMajor = 0; cVersionMinor = 1; cVersionRevision = 3; - cVersionBuild = 25; + cVersionBuild = 26; implementation diff --git a/src/forms/ljv.forms.main.pas b/src/forms/ljv.forms.main.pas index 23ef78a..3887793 100644 --- a/src/forms/ljv.forms.main.pas +++ b/src/forms/ljv.forms.main.pas @@ -643,13 +643,6 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData); jtNumber:begin posY:= 8; - //lbl:= TLabel.Create(panValue); - //lbl.Parent:= panValue; - //lbl.Top:= posY; - //lbl.Left:=8; - //lbl.Caption:= rsLabelValue; - //Inc(posY, 17); - edt:= TEdit.Create(panValue); edt.Parent:= panValue; edt.Top:= posY; @@ -659,7 +652,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData); edt.ReadOnly:= True; Inc(posY, 50); - if TJSONNumber(AJSONData).NumberType in [ntInteger, ntQWord] then + if TJSONNumber(AJSONData).NumberType in [ntInteger, ntInt64, ntQWord] then begin lblBin:= TLabel.Create(panValue); lblBin.Parent:= panValue; @@ -676,10 +669,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData); edtBin.Anchors:= [akTop, akLeft, akRight]; edtBin.ReadOnly:= True; Inc(posY, 34); - end; - if TJSONNumber(AJSONData).NumberType in [ntInteger, ntInt64, ntQWord] then - begin lblHex:= TLabel.Create(panValue); lblHex.Parent:= panValue; lblHex.Top:= posY; @@ -744,7 +734,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData); case TJSONNumber(AJSONData).NumberType of ntInteger:begin edt.Text:= Format('%d', [AJSONData.AsInteger]); - edtBin.Text:= IntToBin(AJSONData.AsInteger, 32, 8); + edtBin.Text:= IntToBin(AJSONData.AsInt64, 32); edtHex.Text:= IntToHex(AJSONData.AsInteger, 16); edtBytes.Text:= FormatBytes(AJSONData.AsInteger); edtDateTime.Text:= FormatDateTime(cDateTimeFormat, UnixToDateTime(AJSONData.AsInteger)); @@ -754,7 +744,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData); edt.Text:= Format('%d', [AJSONData.AsInt64]); { #todo -ogcarreno : Need to fix IntToBin only outputting 32 bits } - //edtBin.Text:= IntToBin(AJSONData.AsInteger, 32, 8); + edtBin.Text:= IntToBin(AJSONData.AsInt64, 64); edtHex.Text:= IntToHex(AJSONData.AsInt64, 16); edtBytes.Text:= FormatBytes(AJSONData.AsInt64); @@ -766,7 +756,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData); end; ntQWord:begin edt.Text:= Format('%d', [AJSONData.AsQWord]); - edtBin.Text:= IntToBin(AJSONData.AsQWord, 32, 8); + edtBin.Text:= IntToBin(AJSONData.AsInt64, 64); edtHex.Text:= IntToHex(AJSONData.AsQWord, 16); edtBytes.Text:= FormatBytes(AJSONData.AsQWord); edtDateTime.Text:= FormatDateTime(cDateTimeFormat, UnixToDateTime(AJSONData.AsQWord)); diff --git a/src/lazJSONViewer.lpi b/src/lazJSONViewer.lpi index 8f740fd..601de12 100644 --- a/src/lazJSONViewer.lpi +++ b/src/lazJSONViewer.lpi @@ -24,7 +24,7 @@ - + diff --git a/src/lazJSONViewer.res b/src/lazJSONViewer.res index 7e781ebd90a77ab45ddf4be7b886e93f29ae1f63..50843d5f254556149924c2662e0142884492ee98 100644 GIT binary patch delta 30 mcmaEInB&P|jtwR3j8clmr04Bnqbh delta 30 mcmaEInB&P|jtwR3jFOW}+5a+{HWzcW7jrOfFXmt>lmr040t%%7