[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jul 27 08:49:50 UTC 2018


 sc/source/core/inc/interpre.hxx  |    9 +++++++++
 sc/source/core/tool/interpr1.cxx |    4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 0d9f755fec6f29b72e9e4d110da3175ade46588c
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Jul 26 15:30:21 2018 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Fri Jul 27 10:49:16 2018 +0200

    Introduce and use ScInterpreter::IsInArrayContext(), tdf#91502 follow-up
    
    Change-Id: I4c6299e9b6890eb22f50586ceb5788057527e88c
    Reviewed-on: https://gerrit.libreoffice.org/58124
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

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;


More information about the Libreoffice-commits mailing list