sc/source/core/tool/interpr1.cxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
New commits: commit d700377556ca6e1adf5972fcbc8eef658adc0b53 Author: Eike Rathke <er...@redhat.com> AuthorDate: Thu Sep 15 17:07:38 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Sep 19 17:21:51 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 (cherry picked from commit c7bb9521ba67f52e9d665fdd24d40d8b42f0387d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140155 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index bfb897590070..25f334d6835d 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" )