Kaydet (Commit) 0e7593ed authored tarafından Eike Rathke's avatar Eike Rathke

InsertMatrixFormula,InsertTableOp: assert valid cols/rows

We don't check and return without operation for these, so the caller is
responsible for handling bad prerequisites.

Change-Id: I47bf5dc171c2362bf7096022058a51460c6e50e0
üst 08db0b56
...@@ -271,6 +271,7 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, ...@@ -271,6 +271,7 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
SAL_WARN("sc", "ScDocument::InsertMatrixFormula: No table marked"); SAL_WARN("sc", "ScDocument::InsertMatrixFormula: No table marked");
return; return;
} }
assert( ValidColRow( nCol1, nRow1) && ValidColRow( nCol2, nRow2));
SCTAB nTab1 = *rMark.begin(); SCTAB nTab1 = *rMark.begin();
...@@ -353,6 +354,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // multiple (repeate ...@@ -353,6 +354,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // multiple (repeate
{ {
PutInOrder(nCol1, nCol2); PutInOrder(nCol1, nCol2);
PutInOrder(nRow1, nRow2); PutInOrder(nRow1, nRow2);
assert( ValidColRow( nCol1, nRow1) && ValidColRow( nCol2, nRow2));
SCTAB i, nTab1; SCTAB i, nTab1;
SCCOL j; SCCOL j;
SCROW k; SCROW k;
......
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