From 4938bf8ec4bd4e6b0fa05cf45088d93e7ef99a3f Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 29 Jan 2017 16:09:52 +0000 Subject: [PATCH] fpspreadsheet: Overload also worksheet *function* WriteCellValueAsString. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5729 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../source/common/fpspreadsheet.pas | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/components/fpspreadsheet/source/common/fpspreadsheet.pas b/components/fpspreadsheet/source/common/fpspreadsheet.pas index 6f5f1d4db..43beb71f4 100644 --- a/components/fpspreadsheet/source/common/fpspreadsheet.pas +++ b/components/fpspreadsheet/source/common/fpspreadsheet.pas @@ -207,6 +207,8 @@ type procedure WriteBoolValue(ACell: PCell; AValue: Boolean); overload; function WriteCellValueAsString(ARow, ACol: Cardinal; AValue: String): PCell; overload; + function WriteCellValueAsString(ARow, ACol: Cardinal; AValue: String; + const AFormatSettings: TFormatSettings): PCell; overload; procedure WriteCellValueAsString(ACell: PCell; AValue: String); overload; procedure WriteCellValueAsString(ACell: PCell; AValue: String; const AFormatSettings: TFormatSettings); overload; @@ -4886,6 +4888,27 @@ begin WriteCellValueAsString(Result, AValue); end; +{@@ ---------------------------------------------------------------------------- + Writes data defined as a string into a cell. Depending on the structure of the + string, the worksheet tries to guess whether it is a number, a date/time or + a text and calls the corresponding writing method. + + @param ARow Row index of the cell + @param ACol Column index of the cell + @param AValue Value to be written into the cell given as a string. Depending + on the structure of the string, however, the value is written + as a number, a date/time or a text. + @param AFormatSettings FormatSettings record used for conversion of strings + with date/time, numbers etc. + @return Pointer to the cell +-------------------------------------------------------------------------------} +function TsWorksheet.WriteCellValueAsString(ARow, ACol: Cardinal; + AValue: String; const AFormatSettings: TFormatSettings): PCell; +begin + Result := GetCell(ARow, ACol); + WriteCellValueAsString(Result, AValue, AFormatSettings); +end; + {@@ ---------------------------------------------------------------------------- Writes data defined as a string into a cell. Depending on the structure of the string, the worksheet tries to guess whether it is a number, a date/time or