diff options
author | Eike Rathke <erack@redhat.com> | 2017-06-15 13:05:16 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-06-15 23:08:55 +0200 |
commit | b85a1921585d70323c1c10ea6a7d29f1aa00ed25 (patch) | |
tree | e84cb7f5cef05b972de10f5ec44e3f7d1f4932cc /sc | |
parent | ac80b0687b4a9ed345be68e446dbf11258ef0b28 (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>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr7.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/unoobj/funcuno.cxx | 2 |
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 |