From dfc01330c2b261be58dca3dd7bc044e695b052bf Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 6 Mar 2017 23:31:48 +0000 Subject: [PATCH] biffexplorer: Fix display of protection items. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5796 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/biffexplorer/BIFFExplorer.lpi | 2 -- applications/biffexplorer/bebiffgrid.pas | 27 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/applications/biffexplorer/BIFFExplorer.lpi b/applications/biffexplorer/BIFFExplorer.lpi index 9c5d577ed..9a5363760 100644 --- a/applications/biffexplorer/BIFFExplorer.lpi +++ b/applications/biffexplorer/BIFFExplorer.lpi @@ -11,8 +11,6 @@ - - diff --git a/applications/biffexplorer/bebiffgrid.pas b/applications/biffexplorer/bebiffgrid.pas index 3eb0d27f5..b66cdba52 100644 --- a/applications/biffexplorer/bebiffgrid.pas +++ b/applications/biffexplorer/bebiffgrid.pas @@ -91,6 +91,7 @@ type procedure ShowNote; procedure ShowNumberCell; procedure ShowObj; + procedure ShowObjProtect; procedure ShowPageSetup; procedure ShowPalette; procedure ShowPane; @@ -493,6 +494,8 @@ begin ShowObj; $005F: ShowRecalc; + $0063: + ShowObjProtect; $007D: ShowColInfo; $0081: @@ -4290,11 +4293,11 @@ begin if Row = FCurrRow then begin FDetails.Add('Cell protection and XF index:'#13); FDetails.Add(Format('x Bits 5-0 = %d: XF Index', [b and $3F])); - case b and $40 of + case (b and $40) shr 6 of 0: FDetails.Add(' Bit 6 = 0: Cell is NOT locked.'); 1: FDetails.Add('x Bit 6 = 1: Cell is locked.'); end; - case b and $80 of + case (b and $80) shr 7 of 0: FDetails.Add(' Bit 7 = 0: Formula is NOT hidden.'); 1: FDetails.Add('x Bit 7 = 1: Formula is hidden.'); end; @@ -4530,6 +4533,26 @@ begin end; +procedure TBIFFGrid.ShowObjProtect; +var + numBytes: Integer; + w: Word; +begin + RowCount := FixedRows + 1; + numBytes := 2; + Move(FBuffer[FBufferIndex], w, numBytes); + w := WordLEToN(w); + if Row = FCurrRow then begin + FDetails.Add('Protection state of objects (drawings etc) in the workbook:'#13); + if w = 0 + then FDetails.Add(' 0 = Objects are NOT protected.') + else FDetails.Add('x 1 = Objects are protected.'); + end; + ShowInRow(FCurrRow, FBufferIndex, numBytes, Format('$%.4x', [w]), + 'Protection state of objects in the workbook'); +end; + + procedure TBIFFGrid.ShowPageSetup; var numBytes: Integer;