Kaydet (Commit) 0ef6263e authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#83764: Ensure that the row position is below MAXROW.

When attempting to split formula groups, else multi_type_vector would
try to locate a block outside its logical range.

Change-Id: I424ede112138de459b5ba3bff5e021c4407ccf3d
üst d07549bc
......@@ -916,11 +916,16 @@ public:
void ScColumn::SplitFormulaGroupByRelativeRef( const ScRange& rBoundRange )
{
if (rBoundRange.aStart.Row() >= MAXROW)
// Nothing to split.
return;
std::vector<SCROW> aBounds;
// Cut at row boundaries first.
aBounds.push_back(rBoundRange.aStart.Row());
aBounds.push_back(rBoundRange.aEnd.Row()+1);
if (rBoundRange.aEnd.Row() < MAXROW)
aBounds.push_back(rBoundRange.aEnd.Row()+1);
sc::SharedFormulaUtil::splitFormulaCellGroups(maCells, aBounds);
RelativeRefBoundChecker aFunc(rBoundRange);
......
......@@ -781,8 +781,11 @@ void ScTable::SortReorderByColumn(
sc::CellStoreType& rCells = aCol[nCol].maCells;
sc::CellStoreType::position_type aPos = rCells.position(nRow1);
sc::SharedFormulaUtil::joinFormulaCellAbove(aPos);
aPos = rCells.position(aPos.first, nRow2+1);
sc::SharedFormulaUtil::joinFormulaCellAbove(aPos);
if (nRow2 < MAXROW)
{
aPos = rCells.position(aPos.first, nRow2+1);
sc::SharedFormulaUtil::joinFormulaCellAbove(aPos);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment