From bac202275b1bf1abe4277daf35f74ff973c23483 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 3 Jun 2022 12:01:13 +0200 Subject: 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 Tested-by: Jenkins --- formula/source/core/api/FormulaCompiler.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'formula') 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(nCurrentFactorParam - 1)) + == ParamClass::Value) { // Propagate to caller as if a function returning an array/matrix // was called (see also below). -- cgit