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
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a4f316c..94f4599 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" )