You've already forked lazarus-ccr
fpspreadsheet: Fix speed issues in saving large files due to unnecessary calculation of col/row limits.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3615 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -2988,6 +2988,7 @@ begin
|
|||||||
// Now loop through all rows
|
// Now loop through all rows
|
||||||
r := firstRow;
|
r := firstRow;
|
||||||
while (r <= lastRow) do begin
|
while (r <= lastRow) do begin
|
||||||
|
rowsRepeated := 1;
|
||||||
// Look for the row style of the current row (r)
|
// Look for the row style of the current row (r)
|
||||||
row := ASheet.FindRow(r);
|
row := ASheet.FindRow(r);
|
||||||
if row = nil then
|
if row = nil then
|
||||||
@ -3100,7 +3101,7 @@ begin
|
|||||||
|
|
||||||
// Next row
|
// Next row
|
||||||
inc(r, rowsRepeated);
|
inc(r, rowsRepeated);
|
||||||
rowsRepeated := 1;
|
// rowsRepeated := 1;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2917,6 +2917,7 @@ var
|
|||||||
r, c: Cardinal;
|
r, c: Cardinal;
|
||||||
cell: PCell;
|
cell: PCell;
|
||||||
base: PCell;
|
base: PCell;
|
||||||
|
lastCol, lastRow: Cardinal;
|
||||||
begin
|
begin
|
||||||
base := FindSharedFormulaBase(ACell);
|
base := FindSharedFormulaBase(ACell);
|
||||||
if base = nil then begin
|
if base = nil then begin
|
||||||
@ -2928,15 +2929,17 @@ begin
|
|||||||
ARow2 := ARow1;
|
ARow2 := ARow1;
|
||||||
ACol1 := base^.Col;
|
ACol1 := base^.Col;
|
||||||
ACol2 := ACol1;
|
ACol2 := ACol1;
|
||||||
|
lastCol := GetLastOccupiedColIndex;
|
||||||
|
lastRow := GetLastOccupiedRowIndex;
|
||||||
// ... and go along first COLUMN to find the end of the shared formula block, ...
|
// ... and go along first COLUMN to find the end of the shared formula block, ...
|
||||||
for c := ACol1+1 to GetLastOccupiedColIndex do
|
for c := ACol1+1 to lastCol do
|
||||||
begin
|
begin
|
||||||
cell := FindCell(ARow1, c);
|
cell := FindCell(ARow1, c);
|
||||||
if (cell <> nil) and (cell^.SharedFormulaBase = base) then
|
if (cell <> nil) and (cell^.SharedFormulaBase = base) then
|
||||||
ACol2 := c;
|
ACol2 := c;
|
||||||
end;
|
end;
|
||||||
// ... and go along first ROW to find the end of the shared formula block
|
// ... and go along first ROW to find the end of the shared formula block
|
||||||
for r := ARow1 + 1 to GetLastOccupiedRowIndex do
|
for r := ARow1 + 1 to lastRow do
|
||||||
begin
|
begin
|
||||||
cell := FindCell(r, ACol1);
|
cell := FindCell(r, ACol1);
|
||||||
if (cell <> nil) and (cell^.SharedFormulaBase = base) then
|
if (cell <> nil) and (cell^.SharedFormulaBase = base) then
|
||||||
@ -2955,9 +2958,14 @@ procedure TsWorksheet.FixSharedFormulas;
|
|||||||
var
|
var
|
||||||
r,c, r1,c1, r2,c2: Cardinal;
|
r,c, r1,c1, r2,c2: Cardinal;
|
||||||
cell: PCell;
|
cell: PCell;
|
||||||
|
firstRow, firstCol, lastRow, lastCol: Cardinal;
|
||||||
begin
|
begin
|
||||||
for r := GetFirstRowIndex to GetLastOccupiedRowIndex do
|
firstRow := GetFirstRowIndex;
|
||||||
for c := GetFirstColIndex to GetlastOccupiedColIndex do
|
firstCol := GetFirstColIndex;
|
||||||
|
lastRow := GetLastOccupiedRowIndex;
|
||||||
|
lastCol := GetLastOccupiedColIndex;
|
||||||
|
for r := firstRow to lastRow do
|
||||||
|
for c := firstCol to lastCol do
|
||||||
begin
|
begin
|
||||||
cell := FindCell(r, c);
|
cell := FindCell(r, c);
|
||||||
if FindSharedFormulaRange(cell, r1, c1, r2, c2) and (r1 = r2) and (c1 = c2) then
|
if FindSharedFormulaRange(cell, r1, c1, r2, c2) and (r1 = r2) and (c1 = c2) then
|
||||||
@ -2976,13 +2984,18 @@ var
|
|||||||
cell: PCell;
|
cell: PCell;
|
||||||
rng: TsCellRange;
|
rng: TsCellRange;
|
||||||
n: Integer;
|
n: Integer;
|
||||||
|
firstRow, firstCol, lastRow, lastCol: Cardinal;
|
||||||
begin
|
begin
|
||||||
|
firstRow := GetFirstRowIndex;
|
||||||
|
lastRow := GetLastOccupiedRowIndex;
|
||||||
|
firstCol := GetFirstColIndex;
|
||||||
|
lastCol := GetLastOccupiedColIndex;
|
||||||
n := 0;
|
n := 0;
|
||||||
SetLength(AList, n);
|
SetLength(AList, n);
|
||||||
for r := GetFirstRowIndex to GetLastOccupiedRowIndex do
|
for r := firstRow to lastRow do
|
||||||
begin
|
begin
|
||||||
c := GetFirstColIndex;
|
c := firstCol;
|
||||||
while (c <= GetLastOccupiedColIndex) do
|
while (c <= lastCol) do
|
||||||
begin
|
begin
|
||||||
cell := FindCell(r, c);
|
cell := FindCell(r, c);
|
||||||
if IsMergeBase(cell) then
|
if IsMergeBase(cell) then
|
||||||
|
Reference in New Issue
Block a user