diff options
author | Eike Rathke <erack@redhat.com> | 2013-04-11 01:29:22 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-04-11 01:31:26 +0200 |
commit | 7c3ab3bc15cec211767490823539efcada4fe964 (patch) | |
tree | bac1ee4c37aede779081e25dea528644ce83efc8 /sc/source/core/tool/interpr1.cxx | |
parent | 3377167bc7bb1dc2ab8010d4bc09824b8492367a (diff) |
resolved fdo#63403 do not create matrix with 0 rows or cols
Change-Id: Icb0000bde3723c1b37713d0f26ef8305c4a199b8
Diffstat (limited to 'sc/source/core/tool/interpr1.cxx')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index d35eebd9f1c8..54277e05a59d 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -4720,6 +4720,13 @@ void ScInterpreter::ScColumn() SCCOL nCols; SCROW nRows; pMyFormulaCell->GetMatColsRows( nCols, nRows); + if (nCols == 0) + { + // Happens if called via ScViewFunc::EnterMatrix() + // ScFormulaCell::GetResultDimensions() as of course a + // matrix result is not available yet. + nCols = 1; + } ScMatrixRef pResMat = GetNewMat( static_cast<SCSIZE>(nCols), 1); if (pResMat) { @@ -4796,6 +4803,13 @@ void ScInterpreter::ScRow() SCCOL nCols; SCROW nRows; pMyFormulaCell->GetMatColsRows( nCols, nRows); + if (nRows == 0) + { + // Happens if called via ScViewFunc::EnterMatrix() + // ScFormulaCell::GetResultDimensions() as of course a + // matrix result is not available yet. + nRows = 1; + } ScMatrixRef pResMat = GetNewMat( 1, static_cast<SCSIZE>(nRows)); if (pResMat) { |