sc/source/core/tool/interpr1.cxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
New commits: commit c7bb9521ba67f52e9d665fdd24d40d8b42f0387d Author: Eike Rathke <er...@redhat.com> AuthorDate: Thu Sep 15 17:07:38 2022 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Thu Sep 15 18:29:12 2022 +0200 Resolves: tdf#132519 Use string reference syntax for CELL("ADDRESS";...) ... so the result can be used with INDIRECT(). Change-Id: I76e4d7739e22c53a3cfa3e004a9b24dc3dfcd233 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140021 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index a4f316c75a78..94f4599e16f3 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2308,8 +2308,26 @@ void ScInterpreter::ScCell() } else if( aInfoType == "ADDRESS" ) { // address formatted as [['FILENAME'#]$TABLE.]$COL$ROW + + // Follow the configurable string reference address syntax as also + // used by INDIRECT() (and ADDRESS() for the sheet separator). + FormulaGrammar::AddressConvention eConv = maCalcConfig.meStringRefAddressSyntax; + switch (eConv) + { + default: + // Use the current address syntax if unspecified or says + // one or the other or one we don't explicitly handle. + eConv = mrDoc.GetAddressConvention(); + break; + case FormulaGrammar::CONV_OOO: + case FormulaGrammar::CONV_XL_A1: + case FormulaGrammar::CONV_XL_R1C1: + // Use that. + break; + } + ScRefFlags nFlags = (aCellPos.Tab() == aPos.Tab()) ? ScRefFlags::ADDR_ABS : ScRefFlags::ADDR_ABS_3D; - OUString aStr(aCellPos.Format(nFlags, &mrDoc, mrDoc.GetAddressConvention())); + OUString aStr(aCellPos.Format(nFlags, &mrDoc, eConv)); PushString(aStr); } else if( aInfoType == "FILENAME" )