fpspreadsheet: Less hints and warnings

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6168 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-02-02 14:43:37 +00:00
parent 55c15c19b3
commit 1e3da067f2

View File

@ -3199,7 +3199,6 @@ procedure TsSpreadBIFF8Writer.WriteLABEL(AStream: TStream;
var var
L: Word; L: Word;
WideStr: WideString; WideStr: WideString;
recSize: Integer;
rec: TBIFF8_LabelRecord; rec: TBIFF8_LabelRecord;
recSST: TBIFF8_LabelSSTRecord; recSST: TBIFF8_LabelSSTRecord;
buf: array of byte; buf: array of byte;
@ -3633,19 +3632,12 @@ function TsSpreadBIFF8Writer.WriteRichTextStream(AStream: TStream;
out AContinueInString: Boolean): Boolean; out AContinueInString: Boolean): Boolean;
var var
strLen: Word; strLen: Word;
optn: Byte;
i, n: Integer;
hasRtp: Boolean; hasRtp: Boolean;
nRtp: Integer; nRtp: Integer;
bytesToWrite: Integer; bytesToWrite: Integer;
savedStartPos: Integer; savedStartPos: Integer;
strSize, rtpSize, hdrSize: Integer; strSize, rtpSize, hdrSize: Int64;
bufSize: Integer;
begin begin
bufsize := ABuffer.Size;
Result := false; Result := false;
ABytesWritten := 0; ABytesWritten := 0;
@ -3661,13 +3653,13 @@ begin
begin begin
nRtp := LEToN(ABuffer.ReadWord); // number of rich-text formatting runs nRtp := LEToN(ABuffer.ReadWord); // number of rich-text formatting runs
inc(hdrSize, SizeOf(word)); inc(hdrSize, SizeOf(word));
rtpSize := nRtp * 4; // 4 bytes per rich-text formatting run rtpSize := Int64(nRtp) * 4; // 4 bytes per rich-text formatting run
end else end else
begin begin
nRtp := 0; nRtp := 0;
rtpSize := 0; rtpSize := 0;
end; end;
strSize := strLen * SizeOf(WideChar); // String length in bytes strSize := Int64(strLen) * SizeOf(WideChar); // String length in bytes
// Begin writing // Begin writing
ABuffer.Position := savedStartPos; ABuffer.Position := savedStartPos;
@ -3690,7 +3682,7 @@ begin
// Case 2; Here some part of the string already has been written, and the // Case 2; Here some part of the string already has been written, and the
// buffer stream is somewhere in the string part // buffer stream is somewhere in the string part
if ABuffer.Position < hdrSize + strSize - 1 then if ABuffer.Position < Int64(hdrSize) + Int64(strSize) - 1 then
begin begin
bytesToWrite := hdrSize + strSize - ABuffer.Position; bytesToWrite := hdrSize + strSize - ABuffer.Position;
if bytesToWrite > ABytesAvail then if bytesToWrite > ABytesAvail then