diff --git a/components/fpspreadsheet/source/common/fpspreadsheet.pas b/components/fpspreadsheet/source/common/fpspreadsheet.pas index c9abed3cc..e149bf598 100644 --- a/components/fpspreadsheet/source/common/fpspreadsheet.pas +++ b/components/fpspreadsheet/source/common/fpspreadsheet.pas @@ -383,6 +383,7 @@ type procedure CalcSheet; function ConvertFormulaDialect(ACell: PCell; ADialect: TsFormulaDialect): String; function ConvertRPNFormulaToStringFormula(const AFormula: TsRPNFormula): String; + function GetFormula(ACell: PCell): PsFormula; { Data manipulation methods - For Cells } procedure CopyCell(AFromCell, AToCell: PCell); overload; @@ -3055,6 +3056,15 @@ begin end; end; +{@@ ---------------------------------------------------------------------------- + Returns a pointer to the formula record assigned to a cell, or nil if the + cell has no formula +-------------------------------------------------------------------------------} +function TsWorksheet.GetFormula(ACell: PCell): PsFormula; +begin + Result := FFormulas.FindFormula(ACell); +end; + {@@ ---------------------------------------------------------------------------- Returns the index of the effective cell format to be used at the specified cell.