From a111a7ba4067dc11070c4b1ab6eb24cc89263770 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 10 May 2018 10:56:27 +0200 Subject: 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 Reviewed-by: Noel Grandin --- sc/source/core/data/table2.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index b0673dd2017d..0f4e91090ffa 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -277,6 +277,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) -- cgit v1.2.3