biffexplorer: Show 3D cell addresses.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6397 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2018-05-08 21:35:12 +00:00
parent 44f158a3aa
commit 199e82661f
2 changed files with 68 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<Version Value="11"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
@ -96,9 +96,10 @@
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default"/>
</Modes>
</RunParams>
<RequiredPackages Count="5">
<Item1>

View File

@ -40,8 +40,9 @@ type
procedure ShowBottomMargin;
procedure ShowCalcCount;
procedure ShowCalcMode;
procedure ShowCellAddress;
procedure ShowCellAddress(ForceRelativeAddress: Boolean = false);
procedure ShowCellAddressRange(AFormat: TsSpreadsheetFormat);
procedure ShowCellAddress3D;
procedure ShowClrtClient;
procedure ShowCodePage;
procedure ShowColInfo;
@ -970,7 +971,7 @@ begin
end;
procedure TBIFFGrid.ShowCellAddress;
procedure TBIFFGrid.ShowCellAddress(ForceRelativeAddress: Boolean = false);
{ Note: The bitmask assignment to relative column/row is reversed in relation
to OpenOffice documentation in order to match with Excel files. }
var
@ -1034,6 +1035,54 @@ begin
end;
procedure TBIFFGrid.ShowCellAddress3D;
var
numBytes: Word;
b: Byte;
w: Word;
i: Int16;
r,c: Integer;
begin
if FFormat = sfExcel5 then begin
{ Excel 5 }
numBytes := 2;
Move(FBuffer[FBufferIndex], i, numBytes);
ShowInRow(FCurrRow, FBufferIndex, numbytes, IntToStr(i),
'1-based index to EXTERNSHEET record (> 0: external ref, < 0: 3D reference)');
if i < 0 then begin
{ 3D reference }
numbytes := 8;
ShowInRow(FCurrRow, FBufferIndex, numbytes, '', '(not used)', true);
numbytes := 2;
Move(FBuffer[FBufferIndex], w, numbytes);
ShowInRow(FCurrRow, FBufferIndex, numbytes, IntToStr(w),
'0-based index to first referenced sheet ($FFFF = deleted sheet)');
numbytes := 2;
Move(FBuffer[FBufferIndex], w, numbytes);
ShowInRow(FCurrRow, FBufferIndex, numbytes, IntToStr(w),
'0-based index to last referenced sheet ($FFFF = deleted sheet)');
end else
if i > 0 then begin
{ external reference }
numbytes := 12;
ShowInRow(FCurrRow, FBufferIndex, numbytes, '', '(not used)', true);
end;
end
else
{ Excel 8 }
if FFormat = sfExcel8 then begin
numbytes := 2;
Move(FBuffer[FBufferIndex], w, numbytes);
ShowInRow(FCurrRow, FBufferIndex, numbytes, IntToStr(w),
'0-based index to REF entry in EXTERNSHEET record');
end;
ShowCellAddress(true);
end;
procedure TBIFFGrid.ShowCellAddressRange(AFormat: TsSpreadsheetFormat);
{ Note: The bitmask assignment to relative column/row is reversed in relation
to OpenOffice documentation in order to match with Excel files.
@ -2988,6 +3037,18 @@ begin
end;
end;
$3A, $5A, $7A:
begin
case token of
$3A: s := 'reference';
$5A: s := 'value';
$7A: s := 'array';
end;
ShowInRow(FCurrRow, FBufferIndex, numBytes, Format('$%.2x', [token]),
Format('Token tREF3D (Cell %s)', [s]));
ShowCellAddress3D;
end;
else
ShowInRow(FCurrRow, FBufferIndex, numBytes, Format('$%.2x', [token]),
'(unknown token)');