summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-08-31 11:23:05 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-08-31 16:46:23 +0200
commitfc91d611a231ae6fc498d0ac32944afb72775b95 (patch)
treed7724b858b728f50c1dafe69eda953ed1ac760c3
parent2ab1136594baf0393d84d2c04d21561847498ac9 (diff)
assert when formula group size is not large enough
That should never happen, as the size should originally come from the formula group size. Change-Id: Ic429ef498bb56d589c04a07d0fb44d9841deb19f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139090 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--sc/source/core/data/column2.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 9fa08657e328..08391bd24150 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -3163,8 +3163,11 @@ void ScColumn::SetFormulaResults( SCROW nRow, const double* pResults, size_t nLe
size_t nBlockLen = it->size - aPos.second;
if (nBlockLen < nLen)
+ {
// Result array is longer than the length of formula cells. Not good.
+ assert( false );
return;
+ }
sc::formula_block::iterator itCell = sc::formula_block::begin(*it->data);
std::advance(itCell, aPos.second);
@@ -3199,8 +3202,11 @@ void ScColumn::CalculateInThread( ScInterpreterContext& rContext, SCROW nRow, si
size_t nBlockLen = it->size - aPos.second;
if (nBlockLen < nLen)
+ {
// Length is longer than the length of formula cells. Not good.
+ assert( false );
return;
+ }
sc::formula_block::iterator itCell = sc::formula_block::begin(*it->data);
std::advance(itCell, aPos.second);
@@ -3232,8 +3238,11 @@ void ScColumn::HandleStuffAfterParallelCalculation( SCROW nRow, size_t nLen, ScI
size_t nBlockLen = it->size - aPos.second;
if (nBlockLen < nLen)
+ {
// Length is longer than the length of formula cells. Not good.
+ assert( false );
return;
+ }
sc::formula_block::iterator itCell = sc::formula_block::begin(*it->data);
std::advance(itCell, aPos.second);