diff --git a/components/fpspreadsheet/fpshtml.pas b/components/fpspreadsheet/fpshtml.pas
index cb9e493c8..0dbcf8381 100644
--- a/components/fpspreadsheet/fpshtml.pas
+++ b/components/fpspreadsheet/fpshtml.pas
@@ -1738,8 +1738,8 @@ end;
procedure TsHTMLWriter.WriteWorksheet(AStream: TStream; ASheet: TsWorksheet);
var
- r, rFirst, rLast: Cardinal;
- c, cFirst, cLast: Cardinal;
+ r, rFirst, rLast: LongInt;
+ c, cFirst, cLast: LongInt;
cell: PCell;
style, s: String;
fixedLayout: Boolean;
diff --git a/components/fpspreadsheet/fpshtmlutils.pas b/components/fpspreadsheet/fpshtmlutils.pas
index 6f4399ad5..77ab125df 100644
--- a/components/fpspreadsheet/fpshtmlutils.pas
+++ b/components/fpspreadsheet/fpshtmlutils.pas
@@ -50,7 +50,7 @@ procedure RichTextToHTML(AWorkbook: TsWorkbook; AFont: TsFont;
implementation
uses
- math, lazUtf8, fasthtmlparser, StrUtils, //Strings,
+ math, lazUtf8, fasthtmlparser, //StrUtils, //Strings,
fpsUtils, fpsClasses;
const
diff --git a/components/fpspreadsheet/fpsnumformatparser.pas b/components/fpspreadsheet/fpsnumformatparser.pas
index a0d976fbd..e61f0dc96 100644
--- a/components/fpspreadsheet/fpsnumformatparser.pas
+++ b/components/fpspreadsheet/fpsnumformatparser.pas
@@ -124,7 +124,7 @@ type
implementation
uses
- TypInfo, Math, LazUTF8, fpsutils, fpsCurrency;
+ TypInfo, Math, LazUTF8, fpsCurrency;
function CreateNumFormatParams(ANumFormatStr: String;
diff --git a/components/fpspreadsheet/fpspreadsheet.pas b/components/fpspreadsheet/fpspreadsheet.pas
index 822e52918..8a79db222 100755
--- a/components/fpspreadsheet/fpspreadsheet.pas
+++ b/components/fpspreadsheet/fpspreadsheet.pas
@@ -879,6 +879,7 @@ var
readerClass: TsSpreadReaderClass;
begin
Result := nil;
+ Unused(AParams);
readerClass := GetSpreadReaderClass(AFormatID);
if readerClass <> nil
@@ -908,6 +909,7 @@ var
writerClass: TsSpreadWriterClass;
begin
Result := nil;
+ Unused(AParams);
writerClass := GetSpreadWriterClass(AFormatID);
if writerClass <> nil then
@@ -6949,8 +6951,6 @@ procedure TsWorkbook.WriteToFile(const AFileName: String;
const AOverwriteExisting: Boolean; AParams: TsStreamParams = []);
var
fileformats: TsSpreadFormatIDArray;
-// formatID: TsSpreadFormatID;
- valid: Boolean;
ext: String;
begin
ext := ExtractFileExt(AFileName);
@@ -7942,10 +7942,10 @@ begin
for i := 0 to n-1 do
begin
sel := clipsheet.GetSelection[i];
- selArray[i].Row1 := sel.Row1 + dr;
- selArray[i].Col1 := sel.Col1 + dc;
- selArray[i].Row2 := sel.Row2 + dr;
- selArray[i].Col2 := sel.Col2 + dc;
+ selArray[i].Row1 := LongInt(sel.Row1) + dr;
+ selArray[i].Col1 := LongInt(sel.Col1) + dc;
+ selArray[i].Row2 := LongInt(sel.Row2) + dr;
+ selArray[i].Col2 := LongInt(sel.Col2) + dc;
end;
ActiveWorksheet.SetSelection(selArray);
// Select active cell. If not found in the file, let's use the last cell of the selections
diff --git a/components/fpspreadsheet/fpspreadsheetctrls.pas b/components/fpspreadsheet/fpspreadsheetctrls.pas
index ade4214fa..cc644edf8 100644
--- a/components/fpspreadsheet/fpspreadsheetctrls.pas
+++ b/components/fpspreadsheet/fpspreadsheetctrls.pas
@@ -1366,8 +1366,6 @@ end;
and deletes them afterwards.
-------------------------------------------------------------------------------}
procedure TsWorkbookSource.CutCellsToClipboard;
-var
- i: Integer;
begin
CopyCellsToClipboard;
FWorksheet.DeleteSelection;
diff --git a/components/fpspreadsheet/fpspreadsheetgrid.pas b/components/fpspreadsheet/fpspreadsheetgrid.pas
index e44abe685..843eca0c3 100644
--- a/components/fpspreadsheet/fpspreadsheetgrid.pas
+++ b/components/fpspreadsheet/fpspreadsheetgrid.pas
@@ -2702,8 +2702,8 @@ begin
// determination since only the height of the first row of the block
// (containing the merge base cell) would change which is very confusing.
exit;
- cellR := CellRect(c1+FHeaderCount, ARow);
- cellR.Right := CellRect(c2+FHeaderCount, ARow).Right;
+ cellR := CellRect(LongInt(c1)+FHeaderCount, ARow);
+ cellR.Right := CellRect(LongInt(c2)+FHeaderCount, ARow).Right;
end;
InflateRect(cellR, -constCellPadding, -constCellPadding);
diff --git a/components/fpspreadsheet/fpsutils.pas b/components/fpspreadsheet/fpsutils.pas
index 5e5840abb..fc953b488 100644
--- a/components/fpspreadsheet/fpsutils.pas
+++ b/components/fpspreadsheet/fpsutils.pas
@@ -664,7 +664,6 @@ function ParseCellString_R1C1(const AStr: String; ABaseRow, ABaseCol: Cardinal;
var
P: PChar;
s: String;
- n: LongInt;
inRowCol: Integer; // 1 = in row, 2 = in col
r, c: LongInt;
inBracket: Boolean;
@@ -927,7 +926,7 @@ begin
Result := 'R' else
Result := 'R[' + IntToStr(delta) + ']';
end else
- Result := 'R' + IntToStr(ARow+1);
+ Result := 'R' + IntToStr(LongInt(ARow)+1);
if rfRelCol in AFlags then
begin
@@ -936,7 +935,7 @@ begin
Result := Result + 'C' else
Result := Result + 'C[' + IntToStr(delta) + ']';
end else
- Result := Result + 'C' + IntToStr(ACol+1);
+ Result := Result + 'C' + IntToStr(LongInt(ACol)+1);
end;
@@ -1092,7 +1091,6 @@ end;
function GetFormatFromFileName(const AFileName: TFileName;
out AFormatID: TsSpreadFormatID): Boolean;
var
- suffix: String;
fileformats: TsSpreadFormatIDArray;
begin
fileFormats := GetSpreadFormatsFromFileName(faRead, AFileName, ord(sfExcel8));
@@ -1114,7 +1112,10 @@ var
fmtID: TsSpreadFormatID;
begin
Result := GetFormatFromFileName(AFileName, fmtID);
- if Result and (fmtID < 0) then Result := false;
+ if fmtID > 0 then
+ SheetType := TsSpreadsheetFormat(fmtID)
+ else if Result then
+ Result := false;
end;
{
diff --git a/components/fpspreadsheet/laz_fpspreadsheet.lpk b/components/fpspreadsheet/laz_fpspreadsheet.lpk
index b140282bf..74cd609fb 100644
--- a/components/fpspreadsheet/laz_fpspreadsheet.lpk
+++ b/components/fpspreadsheet/laz_fpspreadsheet.lpk
@@ -9,7 +9,6 @@
-
diff --git a/components/fpspreadsheet/xlsbiff2.pas b/components/fpspreadsheet/xlsbiff2.pas
index dbb471109..b8cacd12a 100755
--- a/components/fpspreadsheet/xlsbiff2.pas
+++ b/components/fpspreadsheet/xlsbiff2.pas
@@ -161,7 +161,7 @@ implementation
uses
Math,
- fpsStrings, fpsRegFileFormats, fpsReaderWriter, fpsPalette, fpsNumFormat;
+ fpsStrings, fpsRegFileFormats, fpsPalette, fpsNumFormat;
const
{ Excel record IDs }
diff --git a/components/fpspreadsheet/xlsbiff5.pas b/components/fpspreadsheet/xlsbiff5.pas
index 5249e7a83..1f3f7ec89 100755
--- a/components/fpspreadsheet/xlsbiff5.pas
+++ b/components/fpspreadsheet/xlsbiff5.pas
@@ -214,7 +214,7 @@ implementation
uses
Math,
- fpsStrings, fpsRegFileFormats, fpsStreams, fpsReaderWriter, fpsPalette, fpsNumFormat;
+ fpsStrings, fpsRegFileFormats, fpsStreams, fpsPalette, fpsNumFormat;
const
{ Excel record IDs }
diff --git a/components/fpspreadsheet/xlsbiff8.pas b/components/fpspreadsheet/xlsbiff8.pas
index 8ec683f94..c690d7789 100755
--- a/components/fpspreadsheet/xlsbiff8.pas
+++ b/components/fpspreadsheet/xlsbiff8.pas
@@ -264,7 +264,7 @@ implementation
uses
Math, lconvencoding, LazFileUtils, URIParser,
- fpsStrings, fpsStreams, fpsRegFileFormats, fpsReaderWriter, fpsPalette,
+ fpsStrings, fpsStreams, fpsRegFileFormats, fpsPalette,
fpsNumFormat, fpsExprParser, xlsEscher;
const
diff --git a/components/fpspreadsheet/xlsxml.pas b/components/fpspreadsheet/xlsxml.pas
index cf0740ba5..d0fa033f3 100644
--- a/components/fpspreadsheet/xlsxml.pas
+++ b/components/fpspreadsheet/xlsxml.pas
@@ -90,7 +90,7 @@ implementation
uses
StrUtils, Math,
- fpsStrings, fpsRegFileFormats, fpsUtils, fpsStreams, fpsNumFormat, fpsHTMLUtils;
+ fpsStrings, fpsRegFileFormats, fpsUtils, fpsNumFormat, fpsHTMLUtils;
const
FMT_OFFSET = 61;
@@ -318,6 +318,7 @@ end;
procedure TsSpreadExcelXMLWriter.WriteBlank(AStream: TStream;
const ARow, ACol: Cardinal; ACell: PCell);
begin
+ Unused(ARow, ACol);
AppendToStream(AStream, Format(CELL_INDENT +
'' + // colIndex, style, hyperlink, merge
'%s' + // Comment ...
@@ -330,6 +331,7 @@ end;
procedure TsSpreadExcelXMLWriter.WriteBool(AStream: TStream;
const ARow, ACol: Cardinal; const AValue: boolean; ACell: PCell);
begin
+ Unused(ARow, ACol);
AppendToStream(AStream, Format(CELL_INDENT +
'' + // colIndex, style, formula, hyperlink, merge
'' + // data type
@@ -373,6 +375,7 @@ var
nfp: TsNumFormatParams;
fmt: PsCellFormat;
begin
+ Unused(ARow, ACol);
ExcelDate := AValue;
fmt := FWorkbook.GetPointerToCellFormat(ACell^.FormatIndex);
// Times have an offset of 1 day!
@@ -404,6 +407,7 @@ end;
procedure TsSpreadExcelXMLWriter.WriteError(AStream: TStream;
const ARow, ACol: Cardinal; const AValue: TsErrorValue; ACell: PCell);
begin
+ Unused(ARow, ACol);
AppendToStream(AStream, Format(CELL_INDENT +
'' + LF + VALUE_INDENT + // colIndex, style, formula, hyperlink, merge
'' + // data type
@@ -489,6 +493,7 @@ end;
procedure TsSpreadExcelXMLWriter.WriteNumber(AStream: TStream; const ARow, ACol: Cardinal;
const AValue: double; ACell: PCell);
begin
+ Unused(ARow, ACol);
AppendToStream(AStream, Format(CELL_INDENT +
'' + LF + VALUE_INDENT + // colIndex, style, formula, hyperlink, merge
'' + // data type
| | | |