You've already forked lazarus-ccr
fpspreadsheet: Mark TsSpreadsheet.GetLastColNumber/GetLastRowNumber as deprecated, use GetLastColIndex/GetlastRowIndex instead.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3101 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -278,15 +278,15 @@ begin
|
|||||||
MyWorksheet.WriteNumber(r, 2, -number, nfCurrencyRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 2, -number, nfCurrencyRed, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 3, 0.0, nfCurrencyRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 3, 0.0, nfCurrencyRed, 0, 'USD');
|
||||||
inc(r);
|
inc(r);
|
||||||
MyWorksheet.WriteUTF8Text(r, 0, 'nfCurrencyDash, 0 decs');
|
MyWorksheet.WriteUTF8Text(r, 0, 'nfAccounting, 0 decs');
|
||||||
MyWorksheet.WriteNumber(r, 1, number, nfCurrencyDash, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 1, number, nfAccounting, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 2, -number, nfCurrencyDash, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 2, -number, nfAccounting, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 3, 0.0, nfCurrencyDash, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 3, 0.0, nfAccounting, 0, 'USD');
|
||||||
inc(r);
|
inc(r);
|
||||||
MyWorksheet.WriteUTF8Text(r, 0, 'nfCurrencyDashRed, 0 decs');
|
MyWorksheet.WriteUTF8Text(r, 0, 'nfAccountingRed, 0 decs');
|
||||||
MyWorksheet.WriteNumber(r, 1, number, nfCurrencyDashRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 1, number, nfAccountingRed, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 2, -number, nfCurrencyDashRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 2, -number, nfAccountingRed, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 3, 0.0, nfCurrencyDashRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 3, 0.0, nfAccountingRed, 0, 'USD');
|
||||||
inc(r, 2);
|
inc(r, 2);
|
||||||
MyWorksheet.WriteUTF8Text(r, 0, 'nfCustom, "$"#,##0_);("$"#,##0)');
|
MyWorksheet.WriteUTF8Text(r, 0, 'nfCustom, "$"#,##0_);("$"#,##0)');
|
||||||
MyWorksheet.WriteNumber(r, 1, number);
|
MyWorksheet.WriteNumber(r, 1, number);
|
||||||
|
@ -285,15 +285,15 @@ begin
|
|||||||
MyWorksheet.WriteNumber(r, 2, -number, nfCurrencyRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 2, -number, nfCurrencyRed, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 3, 0.0, nfCurrencyRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 3, 0.0, nfCurrencyRed, 0, 'USD');
|
||||||
inc(r);
|
inc(r);
|
||||||
MyWorksheet.WriteUTF8Text(r, 0, 'nfCurrencyDash, 0 decs');
|
MyWorksheet.WriteUTF8Text(r, 0, 'nfAccounting, 0 decs');
|
||||||
MyWorksheet.WriteNumber(r, 1, number, nfCurrencyDash, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 1, number, nfAccounting, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 2, -number, nfCurrencyDash, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 2, -number, nfAccounting, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 3, 0.0, nfCurrencyDash, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 3, 0.0, nfAccounting, 0, 'USD');
|
||||||
inc(r);
|
inc(r);
|
||||||
MyWorksheet.WriteUTF8Text(r, 0, 'nfCurrencyDashRed, 0 decs');
|
MyWorksheet.WriteUTF8Text(r, 0, 'nfAccountingRed, 0 decs');
|
||||||
MyWorksheet.WriteNumber(r, 1, number, nfCurrencyDashRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 1, number, nfAccountingRed, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 2, -number, nfCurrencyDashRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 2, -number, nfAccountingRed, 0, 'USD');
|
||||||
MyWorksheet.WriteNumber(r, 3, 0.0, nfCurrencyDashRed, 0, 'USD');
|
MyWorksheet.WriteNumber(r, 3, 0.0, nfAccountingRed, 0, 'USD');
|
||||||
|
|
||||||
inc(r, 2);
|
inc(r, 2);
|
||||||
MyWorksheet.WriteUTF8Text(r, 0, 'nfCustom, "$"#,##0_);("$"#,##0)');
|
MyWorksheet.WriteUTF8Text(r, 0, 'nfCustom, "$"#,##0_);("$"#,##0)');
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item2>
|
</Item2>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="62">
|
<Units Count="63">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="fpsgrid.lpr"/>
|
<Filename Value="fpsgrid.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -139,21 +139,22 @@
|
|||||||
<UnitName Value="fpspreadsheet"/>
|
<UnitName Value="fpspreadsheet"/>
|
||||||
<EditorIndex Value="5"/>
|
<EditorIndex Value="5"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="523"/>
|
<TopLine Value="1369"/>
|
||||||
<CursorPos X="22" Y="533"/>
|
<CursorPos X="23" Y="1395"/>
|
||||||
<UsageCount Value="100"/>
|
<UsageCount Value="100"/>
|
||||||
<Bookmarks Count="1">
|
<Bookmarks Count="1">
|
||||||
<Item0 X="68" Y="3716" ID="1"/>
|
<Item0 X="68" Y="3718" ID="1"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||||
<UnitName Value="fpspreadsheetgrid"/>
|
<UnitName Value="fpspreadsheetgrid"/>
|
||||||
<EditorIndex Value="7"/>
|
<IsVisibleTab Value="True"/>
|
||||||
|
<EditorIndex Value="9"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="539"/>
|
<TopLine Value="2415"/>
|
||||||
<CursorPos X="42" Y="557"/>
|
<CursorPos X="43" Y="2431"/>
|
||||||
<UsageCount Value="100"/>
|
<UsageCount Value="100"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit3>
|
</Unit3>
|
||||||
@ -207,18 +208,22 @@
|
|||||||
<Unit10>
|
<Unit10>
|
||||||
<Filename Value="..\..\wikitable.pas"/>
|
<Filename Value="..\..\wikitable.pas"/>
|
||||||
<UnitName Value="wikitable"/>
|
<UnitName Value="wikitable"/>
|
||||||
|
<EditorIndex Value="8"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="48"/>
|
<TopLine Value="375"/>
|
||||||
<CursorPos X="41" Y="60"/>
|
<CursorPos X="45" Y="391"/>
|
||||||
<UsageCount Value="8"/>
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit10>
|
</Unit10>
|
||||||
<Unit11>
|
<Unit11>
|
||||||
<Filename Value="..\..\fpsopendocument.pas"/>
|
<Filename Value="..\..\fpsopendocument.pas"/>
|
||||||
<UnitName Value="fpsopendocument"/>
|
<UnitName Value="fpsopendocument"/>
|
||||||
|
<EditorIndex Value="6"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="719"/>
|
||||||
<CursorPos X="1" Y="1"/>
|
<CursorPos X="31" Y="734"/>
|
||||||
<UsageCount Value="4"/>
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit11>
|
</Unit11>
|
||||||
<Unit12>
|
<Unit12>
|
||||||
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
|
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
|
||||||
@ -598,135 +603,142 @@
|
|||||||
<Unit61>
|
<Unit61>
|
||||||
<Filename Value="C:\development\fpc\rtl\win32\sysinitpas.pp"/>
|
<Filename Value="C:\development\fpc\rtl\win32\sysinitpas.pp"/>
|
||||||
<UnitName Value="sysinitpas"/>
|
<UnitName Value="sysinitpas"/>
|
||||||
<IsVisibleTab Value="True"/>
|
|
||||||
<EditorIndex Value="6"/>
|
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="28"/>
|
<TopLine Value="28"/>
|
||||||
<CursorPos X="1" Y="44"/>
|
<CursorPos X="1" Y="44"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit61>
|
</Unit61>
|
||||||
|
<Unit62>
|
||||||
|
<Filename Value="..\..\xlsxooxml.pas"/>
|
||||||
|
<UnitName Value="xlsxooxml"/>
|
||||||
|
<EditorIndex Value="7"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="316"/>
|
||||||
|
<CursorPos X="31" Y="343"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit62>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="30" HistoryIndex="29">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="115" Column="1" TopLine="115"/>
|
<Caret Line="661" Column="3" TopLine="654"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="349" Column="12" TopLine="318"/>
|
<Caret Line="542" Column="56" TopLine="540"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="358" Column="25" TopLine="327"/>
|
<Caret Line="728" Column="1" TopLine="704"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||||
<Caret Line="478" Column="34" TopLine="449"/>
|
<Caret Line="1316" Column="1" TopLine="1285"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||||
<Caret Line="2524" Column="3" TopLine="2520"/>
|
<Caret Line="394" Column="34" TopLine="394"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||||
<Caret Line="2504" Column="46" TopLine="2498"/>
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="mainform.pas"/>
|
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||||
<Caret Line="654" Column="3" TopLine="647"/>
|
<Caret Line="501" Column="18" TopLine="470"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="mainform.pas"/>
|
<Filename Value="..\..\xlscommon.pas"/>
|
||||||
<Caret Line="661" Column="3" TopLine="654"/>
|
<Caret Line="1430" Column="28" TopLine="1430"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="mainform.pas"/>
|
<Filename Value="..\..\xlscommon.pas"/>
|
||||||
<Caret Line="542" Column="56" TopLine="540"/>
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="mainform.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="728" Column="1" TopLine="704"/>
|
<Caret Line="704" Column="21" TopLine="704"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="1316" Column="1" TopLine="1285"/>
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="394" Column="34" TopLine="394"/>
|
<Caret Line="83" Column="19" TopLine="53"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="229" Column="29" TopLine="199"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="501" Column="18" TopLine="470"/>
|
<Caret Line="540" Column="32" TopLine="509"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="..\..\xlscommon.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="1430" Column="28" TopLine="1430"/>
|
<Caret Line="511" Column="29" TopLine="511"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="..\..\xlscommon.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="mainform.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="704" Column="21" TopLine="704"/>
|
<Caret Line="83" Column="19" TopLine="53"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="mainform.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="229" Column="29" TopLine="199"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="mainform.pas"/>
|
<Filename Value="mainform.pas"/>
|
||||||
<Caret Line="83" Column="19" TopLine="53"/>
|
<Caret Line="540" Column="32" TopLine="509"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="mainform.pas"/>
|
|
||||||
<Caret Line="229" Column="29" TopLine="199"/>
|
|
||||||
</Position20>
|
|
||||||
<Position21>
|
|
||||||
<Filename Value="mainform.pas"/>
|
|
||||||
<Caret Line="540" Column="32" TopLine="509"/>
|
|
||||||
</Position21>
|
|
||||||
<Position22>
|
|
||||||
<Filename Value="mainform.pas"/>
|
|
||||||
<Caret Line="511" Column="29" TopLine="511"/>
|
|
||||||
</Position22>
|
|
||||||
<Position23>
|
|
||||||
<Filename Value="mainform.pas"/>
|
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
|
||||||
</Position23>
|
|
||||||
<Position24>
|
|
||||||
<Filename Value="mainform.pas"/>
|
|
||||||
<Caret Line="83" Column="19" TopLine="53"/>
|
|
||||||
</Position24>
|
|
||||||
<Position25>
|
|
||||||
<Filename Value="mainform.pas"/>
|
|
||||||
<Caret Line="229" Column="29" TopLine="199"/>
|
|
||||||
</Position25>
|
|
||||||
<Position26>
|
|
||||||
<Filename Value="mainform.pas"/>
|
|
||||||
<Caret Line="540" Column="32" TopLine="509"/>
|
|
||||||
</Position26>
|
|
||||||
<Position27>
|
|
||||||
<Filename Value="..\..\xlscommon.pas"/>
|
<Filename Value="..\..\xlscommon.pas"/>
|
||||||
<Caret Line="1141" Column="28" TopLine="1111"/>
|
<Caret Line="1141" Column="28" TopLine="1111"/>
|
||||||
</Position27>
|
</Position20>
|
||||||
<Position28>
|
<Position21>
|
||||||
<Filename Value="..\..\xlscommon.pas"/>
|
<Filename Value="..\..\xlscommon.pas"/>
|
||||||
<Caret Line="1142" Column="1" TopLine="1106"/>
|
<Caret Line="1142" Column="1" TopLine="1106"/>
|
||||||
</Position28>
|
</Position21>
|
||||||
<Position29>
|
<Position22>
|
||||||
<Filename Value="..\..\xlscommon.pas"/>
|
<Filename Value="..\..\xlscommon.pas"/>
|
||||||
<Caret Line="1427" Column="3" TopLine="1408"/>
|
<Caret Line="1427" Column="3" TopLine="1408"/>
|
||||||
</Position29>
|
</Position22>
|
||||||
<Position30>
|
<Position23>
|
||||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||||
<Caret Line="533" Column="22" TopLine="523"/>
|
<Caret Line="533" Column="22" TopLine="523"/>
|
||||||
|
</Position23>
|
||||||
|
<Position24>
|
||||||
|
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||||
|
<Caret Line="404" Column="28" TopLine="391"/>
|
||||||
|
</Position24>
|
||||||
|
<Position25>
|
||||||
|
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||||
|
<Caret Line="1361" Column="37" TopLine="1342"/>
|
||||||
|
</Position25>
|
||||||
|
<Position26>
|
||||||
|
<Filename Value="..\..\fpsopendocument.pas"/>
|
||||||
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
|
</Position26>
|
||||||
|
<Position27>
|
||||||
|
<Filename Value="..\..\fpsopendocument.pas"/>
|
||||||
|
<Caret Line="728" Column="41" TopLine="703"/>
|
||||||
|
</Position27>
|
||||||
|
<Position28>
|
||||||
|
<Filename Value="..\..\xlsxooxml.pas"/>
|
||||||
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
|
</Position28>
|
||||||
|
<Position29>
|
||||||
|
<Filename Value="..\..\wikitable.pas"/>
|
||||||
|
<Caret Line="60" Column="41" TopLine="48"/>
|
||||||
|
</Position29>
|
||||||
|
<Position30>
|
||||||
|
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||||
|
<Caret Line="557" Column="42" TopLine="539"/>
|
||||||
</Position30>
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
|
@ -95,7 +95,7 @@ begin
|
|||||||
WriteSecondWorksheet();
|
WriteSecondWorksheet();
|
||||||
|
|
||||||
// Save the spreadsheet to a file
|
// Save the spreadsheet to a file
|
||||||
MyWorkbook.WriteToFile(MyDir + 'test_formula.xls', sfExcel8, False);
|
MyWorkbook.WriteToFile(MyDir + 'test_formula.xls', sfExcel8, True);
|
||||||
// MyWorkbook.WriteToFile(MyDir + 'test_formula.odt', sfOpenDocument, False);
|
// MyWorkbook.WriteToFile(MyDir + 'test_formula.odt', sfOpenDocument, False);
|
||||||
MyWorkbook.Free;
|
MyWorkbook.Free;
|
||||||
end.
|
end.
|
||||||
|
@ -712,26 +712,26 @@ var
|
|||||||
j, k: Integer;
|
j, k: Integer;
|
||||||
CurCell: PCell;
|
CurCell: PCell;
|
||||||
CurRow: array of PCell;
|
CurRow: array of PCell;
|
||||||
LastColNum: Cardinal;
|
LastColIndex: Cardinal;
|
||||||
LCell: TCell;
|
LCell: TCell;
|
||||||
AVLNode: TAVLTreeNode;
|
AVLNode: TAVLTreeNode;
|
||||||
begin
|
begin
|
||||||
LastColNum := CurSheet.GetLastColNumber;
|
LastColIndex := CurSheet.GetLastColIndex;
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
FContent := FContent +
|
FContent := FContent +
|
||||||
' <table:table table:name="' + CurSheet.Name + '" table:style-name="ta1">' + LineEnding +
|
' <table:table table:name="' + CurSheet.Name + '" table:style-name="ta1">' + LineEnding +
|
||||||
' <table:table-column table:style-name="co1" table:number-columns-repeated="' +
|
' <table:table-column table:style-name="co1" table:number-columns-repeated="' +
|
||||||
IntToStr(LastColNum + 1) + '" table:default-cell-style-name="Default"/>' + LineEnding;
|
IntToStr(LastColIndex + 1) + '" table:default-cell-style-name="Default"/>' + LineEnding;
|
||||||
|
|
||||||
// The cells need to be written in order, row by row, cell by cell
|
// The cells need to be written in order, row by row, cell by cell
|
||||||
for j := 0 to CurSheet.GetLastRowNumber do
|
for j := 0 to CurSheet.GetLastRowIndex do
|
||||||
begin
|
begin
|
||||||
FContent := FContent +
|
FContent := FContent +
|
||||||
' <table:table-row table:style-name="ro1">' + LineEnding;
|
' <table:table-row table:style-name="ro1">' + LineEnding;
|
||||||
|
|
||||||
// Write cells from this row.
|
// Write cells from this row.
|
||||||
for k := 0 to LastColNum do
|
for k := 0 to LastColIndex do
|
||||||
begin
|
begin
|
||||||
LCell.Row := j;
|
LCell.Row := j;
|
||||||
LCell.Col := k;
|
LCell.Col := k;
|
||||||
|
@ -401,8 +401,10 @@ type
|
|||||||
function GetNextCell(): PCell;
|
function GetNextCell(): PCell;
|
||||||
function GetFirstCellOfRow(ARow: Cardinal): PCell;
|
function GetFirstCellOfRow(ARow: Cardinal): PCell;
|
||||||
function GetLastCellOfRow(ARow: Cardinal): PCell;
|
function GetLastCellOfRow(ARow: Cardinal): PCell;
|
||||||
function GetLastColNumber: Cardinal;
|
function GetLastColIndex: Cardinal;
|
||||||
function GetLastRowNumber: Cardinal;
|
function GetLastColNumber: Cardinal; deprecated 'Use GetLastColIndex';
|
||||||
|
function GetLastRowIndex: Cardinal;
|
||||||
|
function GetLastRowNumber: Cardinal; deprecated 'Use GetLastRowIndex';
|
||||||
function ReadAsUTF8Text(ARow, ACol: Cardinal): ansistring; overload;
|
function ReadAsUTF8Text(ARow, ACol: Cardinal): ansistring; overload;
|
||||||
function ReadAsUTF8Text(ACell: PCell): ansistring; overload;
|
function ReadAsUTF8Text(ACell: PCell): ansistring; overload;
|
||||||
function ReadAsNumber(ARow, ACol: Cardinal): Double;
|
function ReadAsNumber(ARow, ACol: Cardinal): Double;
|
||||||
@ -1347,7 +1349,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
Returns the 0-based number of the last column with a cell with contents.
|
Returns the 0-based index of the last column with a cell with contents.
|
||||||
|
|
||||||
If no cells have contents, zero will be returned, which is also a valid value.
|
If no cells have contents, zero will be returned, which is also a valid value.
|
||||||
|
|
||||||
@ -1356,7 +1358,7 @@ end;
|
|||||||
|
|
||||||
@see GetCellCount
|
@see GetCellCount
|
||||||
}
|
}
|
||||||
function TsWorksheet.GetLastColNumber: Cardinal;
|
function TsWorksheet.GetLastColIndex: Cardinal;
|
||||||
var
|
var
|
||||||
AVLNode: TAVLTreeNode;
|
AVLNode: TAVLTreeNode;
|
||||||
begin
|
begin
|
||||||
@ -1373,11 +1375,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TsWorksheet.GetLastColNumber: Cardinal;
|
||||||
|
begin
|
||||||
|
Result := GetLastColIndex;
|
||||||
|
end;
|
||||||
|
|
||||||
function TsWorksheet.GetFirstCellOfRow(ARow: Cardinal): PCell;
|
function TsWorksheet.GetFirstCellOfRow(ARow: Cardinal): PCell;
|
||||||
var
|
var
|
||||||
c, n: Cardinal;
|
c, n: Cardinal;
|
||||||
begin
|
begin
|
||||||
n := GetLastColNumber;
|
n := GetLastColIndex;
|
||||||
c := 0;
|
c := 0;
|
||||||
Result := FindCell(ARow, c);
|
Result := FindCell(ARow, c);
|
||||||
while (result = nil) and (c < n) do begin
|
while (result = nil) and (c < n) do begin
|
||||||
@ -1390,7 +1397,7 @@ function TsWorksheet.GetLastCellOfRow(ARow: Cardinal): PCell;
|
|||||||
var
|
var
|
||||||
c, n: Cardinal;
|
c, n: Cardinal;
|
||||||
begin
|
begin
|
||||||
n := GetLastColNumber;
|
n := GetLastColIndex;
|
||||||
c := n;
|
c := n;
|
||||||
Result := FindCell(ARow, c);
|
Result := FindCell(ARow, c);
|
||||||
while (Result = nil) and (c > 0) do begin
|
while (Result = nil) and (c > 0) do begin
|
||||||
@ -1400,7 +1407,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
Returns the 0-based number of the last row with a cell with contents.
|
Returns the 0-based index of the last row with a cell with contents.
|
||||||
|
|
||||||
If no cells have contents, zero will be returned, which is also a valid value.
|
If no cells have contents, zero will be returned, which is also a valid value.
|
||||||
|
|
||||||
@ -1409,7 +1416,7 @@ end;
|
|||||||
|
|
||||||
@see GetCellCount
|
@see GetCellCount
|
||||||
}
|
}
|
||||||
function TsWorksheet.GetLastRowNumber: Cardinal;
|
function TsWorksheet.GetLastRowIndex: Cardinal;
|
||||||
var
|
var
|
||||||
AVLNode: TAVLTreeNode;
|
AVLNode: TAVLTreeNode;
|
||||||
begin
|
begin
|
||||||
@ -1420,6 +1427,11 @@ begin
|
|||||||
Result := PCell(AVLNode.Data).Row;
|
Result := PCell(AVLNode.Data).Row;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TsWorksheet.GetLastRowNumber: Cardinal;
|
||||||
|
begin
|
||||||
|
Result := GetLastRowIndex;
|
||||||
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
Reads the contents of a cell and returns an user readable text
|
Reads the contents of a cell and returns an user readable text
|
||||||
representing the contents of the cell.
|
representing the contents of the cell.
|
||||||
|
@ -2427,8 +2427,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
if FWorksheet <> nil then begin
|
if FWorksheet <> nil then begin
|
||||||
ColCount := FWorksheet.GetLastColNumber + 1 + FHeaderCount;
|
ColCount := FWorksheet.GetLastColIndex + 1 + FHeaderCount;
|
||||||
RowCount := FWorksheet.GetLastRowNumber + 1 + FHeaderCount;
|
RowCount := FWorksheet.GetLastRowIndex + 1 + FHeaderCount;
|
||||||
FixedCols := FFrozenCols + FHeaderCount;
|
FixedCols := FFrozenCols + FHeaderCount;
|
||||||
FixedRows := FFrozenRows + FHeaderCount;
|
FixedRows := FFrozenRows + FHeaderCount;
|
||||||
if ShowHeaders then begin
|
if ShowHeaders then begin
|
||||||
|
@ -148,7 +148,7 @@ begin
|
|||||||
MyWorksheet := GetWorksheetByName(MyWorkBook, ColorsSheet);
|
MyWorksheet := GetWorksheetByName(MyWorkBook, ColorsSheet);
|
||||||
if MyWorksheet=nil then
|
if MyWorksheet=nil then
|
||||||
fail('Error in test code. Failed to get named worksheet');
|
fail('Error in test code. Failed to get named worksheet');
|
||||||
for row := 0 to MyWorksheet.GetLastRowNumber do begin
|
for row := 0 to MyWorksheet.GetLastRowIndex do begin
|
||||||
MyCell := MyWorksheet.FindCell(row, col);
|
MyCell := MyWorksheet.FindCell(row, col);
|
||||||
if MyCell = nil then
|
if MyCell = nil then
|
||||||
fail('Error in test code. Failed to get cell.');
|
fail('Error in test code. Failed to get cell.');
|
||||||
@ -238,7 +238,7 @@ begin
|
|||||||
MyWorksheet := GetWorksheetByName(MyWorkBook, ColorsSheet);
|
MyWorksheet := GetWorksheetByName(MyWorkBook, ColorsSheet);
|
||||||
if MyWorksheet=nil then
|
if MyWorksheet=nil then
|
||||||
fail('Error in test code. Failed to get named worksheet');
|
fail('Error in test code. Failed to get named worksheet');
|
||||||
for row := 0 to MyWorksheet.GetLastRowNumber do begin
|
for row := 0 to MyWorksheet.GetLastRowIndex do begin
|
||||||
MyCell := MyWorksheet.FindCell(row, col);
|
MyCell := MyWorksheet.FindCell(row, col);
|
||||||
if MyCell = nil then
|
if MyCell = nil then
|
||||||
fail('Error in test code. Failed to get cell.');
|
fail('Error in test code. Failed to get cell.');
|
||||||
|
@ -259,8 +259,8 @@ begin
|
|||||||
if MyWorksheet=nil then
|
if MyWorksheet=nil then
|
||||||
fail('Error in test code. Failed to get named worksheet');
|
fail('Error in test code. Failed to get named worksheet');
|
||||||
counter := 0;
|
counter := 0;
|
||||||
for row := 0 to MyWorksheet.GetLastRowNumber do
|
for row := 0 to MyWorksheet.GetLastRowIndex do
|
||||||
for col := 0 to MyWorksheet.GetLastColNumber do begin
|
for col := 0 to MyWorksheet.GetLastColIndex do begin
|
||||||
if (AFormat = sfExcel2) and (counter = 4) then
|
if (AFormat = sfExcel2) and (counter = 4) then
|
||||||
break; // Excel 2 allows only 4 fonts
|
break; // Excel 2 allows only 4 fonts
|
||||||
MyCell := MyWorksheet.FindCell(row, col);
|
MyCell := MyWorksheet.FindCell(row, col);
|
||||||
|
@ -445,7 +445,7 @@ begin
|
|||||||
MyWorksheet := GetWorksheetByName(MyWorkBook, AlignmentSheet);
|
MyWorksheet := GetWorksheetByName(MyWorkBook, AlignmentSheet);
|
||||||
if MyWorksheet=nil then
|
if MyWorksheet=nil then
|
||||||
fail('Error in test code. Failed to get named worksheet');
|
fail('Error in test code. Failed to get named worksheet');
|
||||||
for row := 0 to MyWorksheet.GetLastRowNumber do
|
for row := 0 to MyWorksheet.GetLastRowIndex do
|
||||||
if AFormat = sfExcel2 then begin
|
if AFormat = sfExcel2 then begin
|
||||||
MyCell := MyWorksheet.FindCell(row, col);
|
MyCell := MyWorksheet.FindCell(row, col);
|
||||||
if MyCell = nil then
|
if MyCell = nil then
|
||||||
@ -454,7 +454,7 @@ begin
|
|||||||
CheckEquals(horAlign = MyCell^.HorAlignment, true,
|
CheckEquals(horAlign = MyCell^.HorAlignment, true,
|
||||||
'Test saved horizontal alignment mismatch, cell '+CellNotation(MyWorksheet,row,col));
|
'Test saved horizontal alignment mismatch, cell '+CellNotation(MyWorksheet,row,col));
|
||||||
end else
|
end else
|
||||||
for col := 0 to MyWorksheet.GetLastColNumber do begin
|
for col := 0 to MyWorksheet.GetLastColIndex do begin
|
||||||
MyCell := MyWorksheet.FindCell(row, col);
|
MyCell := MyWorksheet.FindCell(row, col);
|
||||||
if MyCell = nil then
|
if MyCell = nil then
|
||||||
fail('Error in test code. Failed to get cell.');
|
fail('Error in test code. Failed to get cell.');
|
||||||
@ -525,7 +525,7 @@ begin
|
|||||||
MyWorksheet := GetWorksheetByName(MyWorkBook, BordersSheet);
|
MyWorksheet := GetWorksheetByName(MyWorkBook, BordersSheet);
|
||||||
if MyWorksheet=nil then
|
if MyWorksheet=nil then
|
||||||
fail('Error in test code. Failed to get named worksheet');
|
fail('Error in test code. Failed to get named worksheet');
|
||||||
for col := 0 to MyWorksheet.GetLastColNumber do begin
|
for col := 0 to MyWorksheet.GetLastColIndex do begin
|
||||||
MyCell := MyWorksheet.FindCell(row, col);
|
MyCell := MyWorksheet.FindCell(row, col);
|
||||||
if MyCell = nil then
|
if MyCell = nil then
|
||||||
fail('Error in test code. Failed to get cell');
|
fail('Error in test code. Failed to get cell');
|
||||||
@ -820,7 +820,7 @@ begin
|
|||||||
MyWorksheet := GetWorksheetByName(MyWorkBook, TextRotationSheet);
|
MyWorksheet := GetWorksheetByName(MyWorkBook, TextRotationSheet);
|
||||||
if MyWorksheet=nil then
|
if MyWorksheet=nil then
|
||||||
fail('Error in test code. Failed to get named worksheet');
|
fail('Error in test code. Failed to get named worksheet');
|
||||||
for row := 0 to MyWorksheet.GetLastRowNumber do begin
|
for row := 0 to MyWorksheet.GetLastRowIndex do begin
|
||||||
MyCell := MyWorksheet.FindCell(row, col);
|
MyCell := MyWorksheet.FindCell(row, col);
|
||||||
if MyCell = nil then
|
if MyCell = nil then
|
||||||
fail('Error in test code. Failed to get cell');
|
fail('Error in test code. Failed to get cell');
|
||||||
|
@ -82,8 +82,6 @@ begin
|
|||||||
// Open the spreadsheet
|
// Open the spreadsheet
|
||||||
MyWorkbook := TsWorkbook.Create;
|
MyWorkbook := TsWorkbook.Create;
|
||||||
MyWorkbook.ReadFormulas := true;
|
MyWorkbook.ReadFormulas := true;
|
||||||
// MyWorkbook.FormatSettings.DecimalSeparator := '.';
|
|
||||||
// MyWorkbook.FormatSettings.ShortDateFormat := 'yyyy-mm-dd';
|
|
||||||
|
|
||||||
MyWorkbook.ReadFromFile(TempFile, AFormat);
|
MyWorkbook.ReadFromFile(TempFile, AFormat);
|
||||||
if AFormat = sfExcel2 then
|
if AFormat = sfExcel2 then
|
||||||
@ -92,7 +90,7 @@ begin
|
|||||||
MyWorksheet := GetWorksheetByName(MyWorkBook, SHEET);
|
MyWorksheet := GetWorksheetByName(MyWorkBook, SHEET);
|
||||||
if MyWorksheet=nil then
|
if MyWorksheet=nil then
|
||||||
fail('Error in test code. Failed to get named worksheet');
|
fail('Error in test code. Failed to get named worksheet');
|
||||||
for Row := 0 to MyWorksheet.GetLastRowNumber do begin
|
for Row := 0 to MyWorksheet.GetLastRowIndex do begin
|
||||||
cell := MyWorksheet.FindCell(Row, 1);
|
cell := MyWorksheet.FindCell(Row, 1);
|
||||||
if (cell <> nil) and (Length(cell^.RPNFormulaValue) > 0) then begin
|
if (cell <> nil) and (Length(cell^.RPNFormulaValue) > 0) then begin
|
||||||
actual := MyWorksheet.ReadRPNFormulaAsString(cell);
|
actual := MyWorksheet.ReadRPNFormulaAsString(cell);
|
||||||
|
@ -385,10 +385,10 @@ var
|
|||||||
begin
|
begin
|
||||||
AStrings.Add('{| border="1" cellpadding="2" class="wikitable sortable"');
|
AStrings.Add('{| border="1" cellpadding="2" class="wikitable sortable"');
|
||||||
FWorksheet := Workbook.GetFirstWorksheet();
|
FWorksheet := Workbook.GetFirstWorksheet();
|
||||||
for i := 0 to FWorksheet.GetLastRowNumber() do
|
for i := 0 to FWorksheet.GetLastRowIndex() do
|
||||||
begin
|
begin
|
||||||
AStrings.Add('|-');
|
AStrings.Add('|-');
|
||||||
for j := 0 to FWorksheet.GetLastColNumber() do
|
for j := 0 to FWorksheet.GetLastColIndex() do
|
||||||
begin
|
begin
|
||||||
lCurStr := FWorksheet.ReadAsUTF8Text(i, j);
|
lCurStr := FWorksheet.ReadAsUTF8Text(i, j);
|
||||||
lCurUsedFormatting := FWorksheet.ReadUsedFormatting(i, j);
|
lCurUsedFormatting := FWorksheet.ReadUsedFormatting(i, j);
|
||||||
|
@ -314,7 +314,7 @@ var
|
|||||||
j, k: Integer;
|
j, k: Integer;
|
||||||
CurCell: PCell;
|
CurCell: PCell;
|
||||||
CurRow: array of PCell;
|
CurRow: array of PCell;
|
||||||
LastColNum: Cardinal;
|
LastColIndex: Cardinal;
|
||||||
LCell: TCell;
|
LCell: TCell;
|
||||||
AVLNode: TAVLTreeNode;
|
AVLNode: TAVLTreeNode;
|
||||||
CellPosText: string;
|
CellPosText: string;
|
||||||
@ -322,7 +322,7 @@ begin
|
|||||||
FCurSheetNum := Length(FSheets);
|
FCurSheetNum := Length(FSheets);
|
||||||
SetLength(FSheets, FCurSheetNum + 1);
|
SetLength(FSheets, FCurSheetNum + 1);
|
||||||
|
|
||||||
LastColNum := CurSheet.GetLastColNumber;
|
LastColIndex := CurSheet.GetLastColIndex;
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
FSheets[FCurSheetNum] :=
|
FSheets[FCurSheetNum] :=
|
||||||
@ -334,13 +334,13 @@ begin
|
|||||||
' <sheetData>' + LineEnding;
|
' <sheetData>' + LineEnding;
|
||||||
|
|
||||||
// The cells need to be written in order, row by row, cell by cell
|
// The cells need to be written in order, row by row, cell by cell
|
||||||
for j := 0 to CurSheet.GetLastRowNumber do
|
for j := 0 to CurSheet.GetLastRowIndex do
|
||||||
begin
|
begin
|
||||||
FSheets[FCurSheetNum] := FSheets[FCurSheetNum] +
|
FSheets[FCurSheetNum] := FSheets[FCurSheetNum] +
|
||||||
Format(' <row r="%d" spans="1:%d">', [j+1,LastColNum+1]) + LineEnding;
|
Format(' <row r="%d" spans="1:%d">', [j+1,LastColIndex+1]) + LineEnding;
|
||||||
|
|
||||||
// Write cells from this row.
|
// Write cells from this row.
|
||||||
for k := 0 to LastColNum do
|
for k := 0 to LastColIndex do
|
||||||
begin
|
begin
|
||||||
LCell.Row := j;
|
LCell.Row := j;
|
||||||
LCell.Col := k;
|
LCell.Col := k;
|
||||||
|
Reference in New Issue
Block a user