summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-06-15 13:05:16 +0200
committerAndras Timar <andras.timar@collabora.com>2017-06-19 09:43:16 +0200
commit5e23f8c94afedf9e08abade42d92bce8597f3124 (patch)
treea425c01555b1c13904ced8e4bede12f114de4c6f /sc
parent98ddf9a3ee9aa848798f8f2e5f3d576206195a2a (diff)
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@googlemail.com> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit b85a1921585d70323c1c10ea6a7d29f1aa00ed25)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr7.cxx6
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx2
2 files changed, 8 insertions, 0 deletions
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