[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sc/source

Eike Rathke erack at redhat.com
Thu Jun 15 21:09:19 UTC 2017


 sc/source/core/tool/interpr7.cxx |    6 ++++++
 sc/source/ui/unoobj/funcuno.cxx  |    2 ++
 2 files changed, 8 insertions(+)

New commits:
commit b85a1921585d70323c1c10ea6a7d29f1aa00ed25
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Jun 15 13:05:16 2017 +0200

    Resolves: tdf#104989 a matrix/array formula cell needs to have dimensions
    
     This is a combination of 2 commits.
    
    Resolves: tdf#104989 a matrix/array formula cell needs to have dimensions
    
    Most spreadsheet functions don't need it, but some may.
    
    (cherry picked from commit 033d018a3a1d345d61f3c4dc4da693cdd4004dea)
    
    Ensure all cases push an error return, tdf#104989 related (not the cause)
    
    A formula cell in matrix context could have no dimensions.. (which is the cause
    but elsewhere).
    
    (cherry picked from commit e6abe9c3d06d6776e05bef93b5e6f87b403ea967)
    
    1a04f9808d8f5c802789e3db77052351b24c24c7
    
    Change-Id: I954acaa0a64c4dac8d15acd5b3f404019a7e0bce
    Reviewed-on: https://gerrit.libreoffice.org/38832
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index 69eed575810b..b226717c2935 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -83,6 +83,11 @@ void ScInterpreter::ScFilterXML()
 
             }
         }
+        if (!nMatCols || !nMatRows)
+        {
+            PushNoValue();
+            return;
+        }
 
         OUString aXPathExpression = GetString().getString();
         OUString aString = GetString().getString();
@@ -124,6 +129,7 @@ void ScInterpreter::ScFilterXML()
         switch(pXPathObj->type)
         {
             case XPATH_UNDEFINED:
+                PushNoValue();
                 break;
             case XPATH_NODESET:
                 {
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 31f2e1eacb7b..e9dd22b0ba0a 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -611,6 +611,8 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName,
             pDoc, aFormulaPos, aTokenArr, formula::FormulaGrammar::GRAM_API,
             (sal_uInt8)(mbArray ? MM_FORMULA : MM_NONE) );
         pFormula = pDoc->SetFormulaCell(aFormulaPos, pFormula);
+        if (mbArray && pFormula)
+            pFormula->SetMatColsRows(1,1);  // the cell dimensions (only one cell)
 
         //  call GetMatrix before GetErrCode because GetMatrix always recalculates
         //  if there is no matrix result


More information about the Libreoffice-commits mailing list