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