From 748fea48a15d7ea54d859bb7029ef2eada0f80d9 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 24 Feb 2019 11:25:28 +0000 Subject: [PATCH] fpspreadsheet: Add method TsWorksheet.GetFormula to return the formula associated with a cell. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6818 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../fpspreadsheet/source/common/fpspreadsheet.pas | 10 ++++++++++ 1 file changed, 10 insertions(+) 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.