diff options
author | Eike Rathke <erack@redhat.com> | 2019-02-26 23:11:34 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-02-27 13:57:57 +0100 |
commit | aa1b922c0f667d833e53b282ad9bbb78dec38502 (patch) | |
tree | e91bcaf6af585ae915df9a6082399359d1fddbbc /sc | |
parent | d34c0852d73b1b02115cc6c469106fabd057dbb7 (diff) |
Simplify condition whether to return array of references or matrix
Now that we have ParamClass::ReferenceOrRefArray and supporting
functions use it as parameter classification and it is set at the
called function in array/matrix context, use it as indicator when
to return the reference list array and when to return the result
matrix.
Change-Id: I1fd6001f51530b0d1cfd61320f1cd58521c4fa40
Reviewed-on: https://gerrit.libreoffice.org/68426
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index a31897a0de1b..e6266550f3e6 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -837,19 +837,14 @@ bool ScInterpreter::JumpMatrix( short nStackLevel ) { // We're done with it, throw away jump matrix, keep result. // For an intermediate result of Reference use the array of references // if there are more than one reference and the current ForceArray - // context is not ForceArray or suppressed. Note that also - // ReferenceOrRefArray forces the array of references as result if - // there is more than one reference. + // context is ReferenceOrRefArray. // Else (also for a final result of Reference) use the matrix. // Treat the result of a jump command as final and use the matrix (see // tdf#115493 for why). - ParamClass eParamClass; - if (!FormulaCompiler::IsOpCodeJumpCommand( pJumpMatrix->GetOpCode()) && + if (pCur->GetInForceArray() == ParamClass::ReferenceOrRefArray && pJumpMatrix->GetRefList().size() > 1 && ScParameterClassification::GetParameterType( pCur, SAL_MAX_UINT16) == ParamClass::Reference && - (eParamClass = pCur->GetInForceArray()) != ParamClass::ForceArray && - eParamClass != ParamClass::ReferenceOrForceArray && - eParamClass != ParamClass::SuppressedReferenceOrForceArray && + !FormulaCompiler::IsOpCodeJumpCommand( pJumpMatrix->GetOpCode()) && aCode.PeekNextOperator()) { FormulaTokenRef xRef = new ScRefListToken(true); |