summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-09-15 17:07:38 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-09-19 17:21:51 +0200
commitd700377556ca6e1adf5972fcbc8eef658adc0b53 (patch)
tree93ddc7e9f3d078f10c2942b09b1355a8fcd1053d
parenttdf#147507 sw: fix crash with Reject All around not content nodes (diff)
downloadcore-d700377556ca6e1adf5972fcbc8eef658adc0b53.tar.gz
core-d700377556ca6e1adf5972fcbc8eef658adc0b53.zip
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 <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit c7bb9521ba67f52e9d665fdd24d40d8b42f0387d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140155 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/source/core/tool/interpr1.cxx20
1 files changed, 19 insertions, 1 deletions
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" )