summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-10 10:56:27 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-06-05 17:53:14 +0200
commitc30963b8b4bbbe42a24b97aafa161eff9d7ccdd4 (patch)
treeee4aef5a7506ea1d616231be464cb6ad01af35bc
parent2f923aa12e2cbb759e504e06dd3efdfd9e552d34 (diff)
tdf#117522 Calc Column Width after Insert Columns
regression from commit d6fb5ca5661195520ca7a7ca2d0145a1e11be099 dyncolcontainer: use ScCompressedArray for pColWidth Change-Id: I65d1197c0c638216e063f74def4efb98bfbb9aad Reviewed-on: https://gerrit.libreoffice.org/54067 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit a111a7ba4067dc11070c4b1ab6eb24cc89263770) Reviewed-on: https://gerrit.libreoffice.org/55119 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/data/table2.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index b7b169e418b8..4be3a7ec6840 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -284,6 +284,9 @@ void ScTable::InsertCol(
if (mpColWidth && mpColFlags)
{
mpColWidth->InsertPreservingSize(nStartCol, nSize, STD_COL_WIDTH);
+ // The inserted columns have the same widths as the columns, which were selected for insert.
+ for (SCSIZE i=0; i < std::min(MAXCOL-nSize-nStartCol, nSize); ++i)
+ mpColWidth->SetValue(nStartCol + i, mpColWidth->GetValue(nStartCol+i+nSize));
mpColFlags->InsertPreservingSize(nStartCol, nSize, CRFlags::NONE);
}
if (pOutlineTable)