fpspreadsheet: Some clean-up

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6769 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2018-12-25 08:58:16 +00:00
parent 8b3b74de88
commit 3f113c63bb
7 changed files with 11 additions and 13 deletions

View File

@ -4310,8 +4310,8 @@ begin
exit; exit;
end; end;
for formula in sheet.Formulas do for formula in sheet.Formulas do
if (formula^.Row >= r[1]) and (formula^.Row <= r[2]) and if (Integer(formula^.Row) >= r[1]) and (Integer(formula^.Row) <= r[2]) and
(formula^.Col >= c[1]) and (formula^.Col <= c[2]) (Integer(formula^.Col) >= c[1]) and (Integer(formula^.Col) <= c[2])
then then
case formula^.CalcState of case formula^.CalcState of
csNotCalculated: csNotCalculated:

View File

@ -2115,14 +2115,11 @@ var
arg: TsExpressionResult; arg: TsExpressionResult;
sheet: TsWorksheet; sheet: TsWorksheet;
book: TsWorkbook; book: TsWorkbook;
f: TsRelFlags;
function Matches(ACell: PCell): Boolean; function Matches(ACell: PCell): Boolean;
var var
cellval: Double; cellval: Double;
s: String; s: String;
ok: boolean;
begin begin
Result := false; Result := false;
if ACell = nil then exit; if ACell = nil then exit;
@ -2148,7 +2145,6 @@ var
-1 : Result := cellval >= numSearchValue; -1 : Result := cellval >= numSearchValue;
end; end;
end; end;
ok := result;
end; end;
begin begin

View File

@ -363,6 +363,7 @@ end;
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
class function TsCustomSpreadReader.CheckFileFormat(AStream: TStream): boolean; class function TsCustomSpreadReader.CheckFileFormat(AStream: TStream): boolean;
begin begin
Unused(AStream);
Result := true; Result := true;
end; end;
@ -371,6 +372,7 @@ end;
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
class function TsCustomSpreadReader.CheckFileFormatDetails(AStream: TStream): Boolean; class function TsCustomSpreadReader.CheckFileFormatDetails(AStream: TStream): Boolean;
begin begin
Unused(AStream);
Result := true; Result := true;
end; end;

View File

@ -419,7 +419,7 @@ const
ZIP_HEADER: packed array[0..1] of char = ('P', 'K'); ZIP_HEADER: packed array[0..1] of char = ('P', 'K');
var var
P: Int64; P: Int64;
buf: packed array[0..1] of char; buf: packed array[0..1] of char = (#0, #0);
begin begin
Result := false; Result := false;
P := AStream.Position; P := AStream.Position;

View File

@ -342,7 +342,7 @@ const
$09,$00, $04,$00); // they are common to all BIFF2 files that I've seen $09,$00, $04,$00); // they are common to all BIFF2 files that I've seen
var var
P: Int64; P: Int64;
buf: packed array[0..3] of byte; buf: packed array[0..3] of byte = (0, 0, 0, 0);
n: Integer; n: Integer;
begin begin
Result := false; Result := false;
@ -1044,7 +1044,7 @@ begin
$02: AStream.ReadByte; // tAttrIF, not explicitely used $02: AStream.ReadByte; // tAttrIF, not explicitely used
$04: begin // tAttrChoose, not supported $04: begin // tAttrChoose, not supported
nc := AStream.ReadByte; nc := AStream.ReadByte;
AStream.Position := AStream.Position + 2*nc + 1; AStream.Position := AStream.Position + 2*Int64(nc) + 1;
end; end;
$08: AStream.ReadByte; // tAttrSkip, data not used $08: AStream.ReadByte; // tAttrSkip, data not used
$10: AStream.ReadByte; // tAttrSum, to be processed by ReadRPNTokenArray, byte not used $10: AStream.ReadByte; // tAttrSum, to be processed by ReadRPNTokenArray, byte not used

View File

@ -1191,7 +1191,7 @@ const
$D0,$CF, $11,$E0, $A1,$B1, $1A,$E1); $D0,$CF, $11,$E0, $A1,$B1, $1A,$E1);
var var
P: Int64; P: Int64;
buf: packed array[0..7] of byte; buf: packed array[0..7] of byte = (0, 0, 0, 0, 0, 0, 0, 0);
n: Integer; n: Integer;
begin begin
Result := false; Result := false;
@ -2582,7 +2582,7 @@ end;
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TsSpreadBIFFReader.ReadRPNAttr(AStream: TStream; AIdentifier: Byte); procedure TsSpreadBIFFReader.ReadRPNAttr(AStream: TStream; AIdentifier: Byte);
var var
nc: Integer; nc: Int64;
begin begin
case AIdentifier of case AIdentifier of
$01: AStream.ReadWord; // tAttrVolatile token, skip $01: AStream.ReadWord; // tAttrVolatile token, skip
@ -3027,7 +3027,7 @@ var
rpnItem: PRPNItem; rpnItem: PRPNItem;
supported: boolean; supported: boolean;
dblVal: Double = 0.0; // IEEE 8 byte floating point number dblVal: Double = 0.0; // IEEE 8 byte floating point number
flags, flags2: TsRelFlags; flags: TsRelFlags;
r, c, r2, c2: Cardinal; r, c, r2, c2: Cardinal;
dr, dc, dr2, dc2: Integer; dr, dc, dr2, dc2: Integer;
fek: TFEKind; fek: TFEKind;

View File

@ -4134,7 +4134,7 @@ var
ext: String; ext: String;
img: TsImage; img: TsImage;
rId: Integer; rId: Integer;
hlink, target, bookmark: String; target, bookmark: String;
u: TURI; u: TURI;
sheet: TsWorksheet absolute AWorksheet; sheet: TsWorksheet absolute AWorksheet;
begin begin