summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-06-03 12:01:13 +0200
committerEike Rathke <erack@redhat.com>2022-06-03 13:08:11 +0200
commitbac202275b1bf1abe4277daf35f74ff973c23483 (patch)
treef7b04e440d33ddbd363da5477841cdc580095bc6 /formula
parent6697257931f8e9ed76b2c6a32b310456c94f2848 (diff)
Propagate inline array only for Value parameters, tdf#149378 follow-up
So in SUM({1;2}) the SUM does not inherit it, but in ABS({-1;-2}) the ABS still does. This was always off, but so far didn't matter. Change-Id: I00dfcd4b71b8dea943475bb5a593224312258e31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135349 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 560377d0d5d5..cf2cc01b4584 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -2816,7 +2816,10 @@ void FormulaCompiler::ForceArrayOperator( FormulaTokenRef const & rCurr )
if (bInlineArray)
{
// rCurr->SetInForceArray() can not be used with ocPush.
- if (pCurrentFactorToken && pCurrentFactorToken->GetInForceArray() == ParamClass::Unknown)
+ if (nCurrentFactorParam > 0 && pCurrentFactorToken
+ && pCurrentFactorToken->GetInForceArray() == ParamClass::Unknown
+ && GetForceArrayParameter( pCurrentFactorToken.get(), static_cast<sal_uInt16>(nCurrentFactorParam - 1))
+ == ParamClass::Value)
{
// Propagate to caller as if a function returning an array/matrix
// was called (see also below).