diff options
author | Eike Rathke <erack@redhat.com> | 2018-07-26 15:30:21 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-07-27 10:49:16 +0200 |
commit | 0d9f755fec6f29b72e9e4d110da3175ade46588c (patch) | |
tree | 6d7f448a43305e3e77962ce760fa3373c2309ed9 /sc | |
parent | 2008a520e429bc2581001d61b63ff934c2255be0 (diff) |
Introduce and use ScInterpreter::IsInArrayContext(), tdf#91502 follow-up
Change-Id: I4c6299e9b6890eb22f50586ceb5788057527e88c
Reviewed-on: https://gerrit.libreoffice.org/58124
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/inc/interpre.hxx | 9 | ||||
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index e7d7f5e2aff8..ae62eae0dc2d 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -391,6 +391,10 @@ private: void ConvertMatrixJumpConditionToMatrix(); // If MatrixFormula or ForceArray: ConvertMatrixParameters() inline bool MatrixParameterConversion(); + // If MatrixFormula or ForceArray. Can be used within spreadsheet functions + // that do not depend on the formula cell's matrix size, for which only + // bMatrixFormula can be used. + inline bool IsInArrayContext() const; ScMatrixRef PopMatrix(); sc::RangeMatrix PopRangeMatrix(); void QueryMatrixType(const ScMatrixRef& xMat, SvNumFormatType& rRetTypeExpr, sal_uInt32& rRetIndexExpr); @@ -1013,6 +1017,11 @@ public: sal_uLong GetRetFormatIndex() const { return nRetFmtIndex; } }; +inline bool ScInterpreter::IsInArrayContext() const +{ + return bMatrixFormula || pCur->IsInForceArray(); +} + inline void ScInterpreter::MatrixJumpConditionToMatrix() { if (bMatrixFormula || pCur->IsInForceArray()) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index c0558c869ad4..3baa2793d9ad 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2691,7 +2691,7 @@ void ScInterpreter::ScIsFormula() switch ( GetStackType() ) { case svDoubleRef : - if (bMatrixFormula || pCur->IsInForceArray()) + if (IsInArrayContext()) { SCCOL nCol1, nCol2; SCROW nRow1, nRow2; @@ -2759,7 +2759,7 @@ void ScInterpreter::ScFormula() switch ( GetStackType() ) { case svDoubleRef : - if (bMatrixFormula || pCur->IsInForceArray()) + if (IsInArrayContext()) { SCCOL nCol1, nCol2; SCROW nRow1, nRow2; |