fpspreadsheet: Fix INDIRECT formula when the argument is a string

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9351 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2024-05-24 21:20:41 +00:00
parent a7fe32c308
commit 5d277d115f
2 changed files with 5 additions and 4 deletions

View File

@ -4862,19 +4862,20 @@ end;
function CellResult(AValue: String): TsExpressionResult;
var
p: Integer;
sheetName: String;
begin
Result.ResultType := rtCell;
p := pos('!', AValue);
if p = 0 then
begin
ParseCellString(AValue, Result.ResRow, Result.ResCol);
Result.ResSheetName := '';
ParseSheetCellString(AValue, sheetName, Result.ResRow, Result.ResCol);
Result.ResSheetName := sheetName;
end else
begin
Result.ResSheetName := Copy(AValue, 1, p-1);
ParseCellString(Copy(AValue, p+1, MaxInt), Result.ResRow, Result.ResCol);
Result.Worksheet := nil; // this signals that the worksheet needs still to be determiend
end;
Result.Worksheet := nil; // this signals that the worksheet needs still to be determined
end;
function CellResult(ACellRow, ACellCol: Cardinal): TsExpressionResult;

View File

@ -2240,7 +2240,7 @@ procedure fpsINDIRECT(var Result: TsExpressionResult;
{ INDIRECT(string_reference, [ref_style])
returns the reference to a cell based on its string representation
"string_reference": textual representation of a cell reference.
"ref_style": TRUE (default) ndicates that string_reference will be interpreted
"ref_style": TRUE (default) indicates that string_reference will be interpreted
as an A1-style reference. FALSE indicates that string_reference will be
interpreted as an R1C1-style reference.