summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-09-18 12:13:13 -0400
committerCaolán McNamara <caolanm@redhat.com>2014-09-25 12:29:05 +0000
commit59e7789744c99b6431461f14694b6f9ab2492a80 (patch)
tree69deb6c1acd8d565c5f6efd66a5e09bd03eef1d4
parent7fb3a39b7492399fd8bdd69589c528c7ded1c1a9 (diff)
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 (cherry picked from commit 0ef6263ed2b31b8f9e431971e6c5e8928996c1c8) Reviewed-on: https://gerrit.libreoffice.org/11518 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/data/column4.cxx7
-rw-r--r--sc/source/core/data/table3.cxx7
2 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 3f26db17752c..93fca482b4a4 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -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);
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 613cb1f684d2..c5bfe758fc5b 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -772,8 +772,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);
+ }
}
}