From 1e3da067f2f47c95d9b5ee7e95dc86141faa15cb Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 2 Feb 2018 14:43:37 +0000 Subject: [PATCH] fpspreadsheet: Less hints and warnings git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6168 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../fpspreadsheet/source/common/xlsbiff8.pas | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/components/fpspreadsheet/source/common/xlsbiff8.pas b/components/fpspreadsheet/source/common/xlsbiff8.pas index 140e6fe5a..8433ff8a2 100644 --- a/components/fpspreadsheet/source/common/xlsbiff8.pas +++ b/components/fpspreadsheet/source/common/xlsbiff8.pas @@ -3199,7 +3199,6 @@ procedure TsSpreadBIFF8Writer.WriteLABEL(AStream: TStream; var L: Word; WideStr: WideString; - recSize: Integer; rec: TBIFF8_LabelRecord; recSST: TBIFF8_LabelSSTRecord; buf: array of byte; @@ -3633,19 +3632,12 @@ function TsSpreadBIFF8Writer.WriteRichTextStream(AStream: TStream; out AContinueInString: Boolean): Boolean; var strLen: Word; - optn: Byte; - i, n: Integer; hasRtp: Boolean; nRtp: Integer; bytesToWrite: Integer; savedStartPos: Integer; - strSize, rtpSize, hdrSize: Integer; - - bufSize: Integer; + strSize, rtpSize, hdrSize: Int64; begin - bufsize := ABuffer.Size; - - Result := false; ABytesWritten := 0; @@ -3661,13 +3653,13 @@ begin begin nRtp := LEToN(ABuffer.ReadWord); // number of rich-text formatting runs 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 begin nRtp := 0; rtpSize := 0; end; - strSize := strLen * SizeOf(WideChar); // String length in bytes + strSize := Int64(strLen) * SizeOf(WideChar); // String length in bytes // Begin writing ABuffer.Position := savedStartPos; @@ -3690,7 +3682,7 @@ begin // Case 2; Here some part of the string already has been written, and the // 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 bytesToWrite := hdrSize + strSize - ABuffer.Position; if bytesToWrite > ABytesAvail then