You've already forked lazarus-ccr
fpspreadsheet: Fix formula cell with 3d reference not updating when referenced cell is deleted.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6423 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -398,6 +398,7 @@ type
|
|||||||
function BuildRPNFormula(ACell: PCell; ADestCell: PCell = nil): TsRPNFormula;
|
function BuildRPNFormula(ACell: PCell; ADestCell: PCell = nil): TsRPNFormula;
|
||||||
procedure CalcFormula(ACell: PCell);
|
procedure CalcFormula(ACell: PCell);
|
||||||
procedure CalcFormulas;
|
procedure CalcFormulas;
|
||||||
|
procedure CalcSheet;
|
||||||
function ConvertFormulaDialect(ACell: PCell; ADialect: TsFormulaDialect): String;
|
function ConvertFormulaDialect(ACell: PCell; ADialect: TsFormulaDialect): String;
|
||||||
function ConvertRPNFormulaToStringFormula(const AFormula: TsRPNFormula): String;
|
function ConvertRPNFormulaToStringFormula(const AFormula: TsRPNFormula): String;
|
||||||
function GetCalcState(ACell: PCell): TsCalcState;
|
function GetCalcState(ACell: PCell): TsCalcState;
|
||||||
@ -1336,7 +1337,9 @@ begin
|
|||||||
cctBool : WriteBoolValue(ACell, cell^.Boolvalue);
|
cctBool : WriteBoolValue(ACell, cell^.Boolvalue);
|
||||||
cctError : WriteErrorValue(ACell, cell^.ErrorValue);
|
cctError : WriteErrorValue(ACell, cell^.ErrorValue);
|
||||||
cctEmpty : WriteBlank(ACell);
|
cctEmpty : WriteBlank(ACell);
|
||||||
end;
|
end
|
||||||
|
else
|
||||||
|
WriteBlank(ACell);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
@ -1348,6 +1351,20 @@ begin
|
|||||||
ACell^.Flags := ACell^.Flags + [cfCalculated] - [cfCalculating];
|
ACell^.Flags := ACell^.Flags + [cfCalculated] - [cfCalculating];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{@@ ----------------------------------------------------------------------------
|
||||||
|
Calculates all formulas of the workbook
|
||||||
|
|
||||||
|
Must be used when the formulas in the workbook contain references to other
|
||||||
|
sheets.
|
||||||
|
If this is not the case the faster "CalcSheet" can be used.
|
||||||
|
-------------------------------------------------------------------------------}
|
||||||
|
procedure TsWorksheet.CalcFormulas;
|
||||||
|
begin
|
||||||
|
Workbook.CalcFormulas;
|
||||||
|
// To do: Determine whether the worksheet has in- and out-going links
|
||||||
|
// to others sheets. If not call the faster "CalcShee".
|
||||||
|
end;
|
||||||
|
|
||||||
{@@ ----------------------------------------------------------------------------
|
{@@ ----------------------------------------------------------------------------
|
||||||
Calculates all formulas of the worksheet.
|
Calculates all formulas of the worksheet.
|
||||||
|
|
||||||
@ -1363,7 +1380,7 @@ end;
|
|||||||
THIS CALCULATION MAY NOT BE CORRECT. USE THE SAME METHOD OF THE WORKBOOK
|
THIS CALCULATION MAY NOT BE CORRECT. USE THE SAME METHOD OF THE WORKBOOK
|
||||||
INSTEAD !!!
|
INSTEAD !!!
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
procedure TsWorksheet.CalcFormulas;
|
procedure TsWorksheet.CalcSheet;
|
||||||
var
|
var
|
||||||
cell: PCell;
|
cell: PCell;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -1412,7 +1429,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{@@ ----------------------------------------------------------------------------
|
{@@ ----------------------------------------------------------------------------
|
||||||
Checks entire workbook, whether this cell is used in any formula.
|
Checks entire worksheet, whether this cell is used in any formula.
|
||||||
|
|
||||||
@param ARow Row index of the cell considered
|
@param ARow Row index of the cell considered
|
||||||
@param ACol Column index of the cell considered
|
@param ACol Column index of the cell considered
|
||||||
@ -1787,7 +1804,7 @@ begin
|
|||||||
|
|
||||||
if (FWorkbook.FCalculationLock = 0) and (boAutoCalc in FWorkbook.Options) then
|
if (FWorkbook.FCalculationLock = 0) and (boAutoCalc in FWorkbook.Options) then
|
||||||
begin
|
begin
|
||||||
if CellUsedInFormula(ARow, ACol) then
|
// if CellUsedInFormula(ARow, ACol) then
|
||||||
CalcFormulas;
|
CalcFormulas;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user