summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-23 16:46:22 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-06-24 14:54:18 +0200
commit2bf38c355df9e5ecc6ec90658fcebc32885ff7d0 (patch)
tree9961051a5c1218af3008b0288918c979902e315f /sc
parentba7c6f5a8ed01320bf15796df2ab196b1b485b48 (diff)
tdf#133326 Crash after redo
regression from commit 7282014e362a1529a36c88eb308df8ed359c2cfa tdf#50916 Makes numbers of columns dynamic. Change-Id: I6a3d6b35dbd442014c84785d97cbd7eae19244cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96958 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 240758a972eb99dd4d26fa6040ff0b6614036621) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96995 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table2.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 1eb549b29ade..0eeceed08ade 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1322,10 +1322,11 @@ void ScTable::UndoToTable(
for ( SCCOL i = 0; i < aCol.size(); i++)
{
+ auto& rDestCol = pDestTab->CreateColumnIfNotExists(i);
if ( i >= nCol1 && i <= nCol2 )
- aCol[i].UndoToColumn(rCxt, nRow1, nRow2, nFlags, bMarked, pDestTab->aCol[i]);
+ aCol[i].UndoToColumn(rCxt, nRow1, nRow2, nFlags, bMarked, rDestCol);
else
- aCol[i].CopyToColumn(rCxt, 0, pDocument->MaxRow(), InsertDeleteFlags::FORMULA, false, pDestTab->aCol[i]);
+ aCol[i].CopyToColumn(rCxt, 0, pDocument->MaxRow(), InsertDeleteFlags::FORMULA, false, rDestCol);
}
if (nFlags & InsertDeleteFlags::ATTRIB)