summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-02-06 23:32:54 +0100
committerAndras Timar <andras.timar@collabora.com>2015-02-23 10:33:42 +0100
commit4c4ef415e2087084f474c02c104d08fff37e0268 (patch)
tree1ada24771e654d621961d27ec1970b76eb3f80a0 /sc
parent6a330f8ae8639e13391b1129a6428b9602e989a4 (diff)
Resolves: tdf#83461 do not override MatColsRows if already set
ScMatrixFormulaCellToken::SetMatColsRows() via ScFormulaCell::SetMatColsRows() is used during document import and preselected cell area input of an array formula. Do not override existing values with subsequent result matrix dimensions. Change-Id: I9e844b5064ea276f3cbcb680eb1127c344328e00 (cherry picked from commit e32eff2bb4c12fdc33e476b9f12bb4bb71d22ebc) Reviewed-on: https://gerrit.libreoffice.org/14355 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit cd1f5a81b7602040a7c88b30fd8dbde844fa2f71)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/formularesult.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx
index 658eb97821e5..d50006b27ade 100644
--- a/sc/source/core/tool/formularesult.cxx
+++ b/sc/source/core/tool/formularesult.cxx
@@ -168,7 +168,7 @@ void ScFormulaResult::SetToken( const formula::FormulaToken* p )
{
const ScMatrixFormulaCellToken* pNewMatFormula =
dynamic_cast<const ScMatrixFormulaCellToken*>(pMatResult);
- if (pNewMatFormula)
+ if (pNewMatFormula && (pMatFormula->GetMatCols() <= 0 || pMatFormula->GetMatRows() <= 0))
{
SAL_WARN( "sc", "ScFormulaResult::SetToken: pNewMatFormula and pMatFormula, overriding matrix formula dimension; intended?");
pMatFormula->SetMatColsRows( pNewMatFormula->GetMatCols(),