summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/document.cxx2
-rw-r--r--sc/source/core/data/table2.cxx7
2 files changed, 7 insertions, 2 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 2e3a27944b50..db97f7773e6c 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1423,7 +1423,7 @@ bool ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab,
for (i=nStartTab; i<=nEndTab && i < static_cast<SCTAB>(maTabs.size()); i++)
if (maTabs[i] && (!pTabMark || pTabMark->GetTableSelect(i)))
- maTabs[i]->InsertCol( nStartCol, nStartRow, nEndRow, nSize );
+ maTabs[i]->InsertCol(aCxt.maRegroupCols, nStartCol, nStartRow, nEndRow, nSize);
if ( pChangeTrack && pChangeTrack->IsInDeleteUndo() )
{ // durch Restaurierung von Referenzen auf geloeschte Bereiche ist
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index d2174de1fb93..f60ed3f92d02 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -341,7 +341,8 @@ bool ScTable::TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize ) cons
}
-void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize )
+void ScTable::InsertCol(
+ const sc::ColumnSet& rRegroupCols, SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize )
{
if (nStartRow==0 && nEndRow==MAXROW)
{
@@ -388,6 +389,10 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE
aCol[MAXCOL - nSize - i].MoveTo(nStartRow, nEndRow, aCol[MAXCOL - i]);
}
+ std::vector<SCCOL> aRegroupCols;
+ rRegroupCols.getColumns(nTab, aRegroupCols);
+ std::for_each(aRegroupCols.begin(), aRegroupCols.end(), ColumnRegroupFormulaCells(aCol));
+
// Transfer those notes that will get shifted into another container.
ScNotes aNotes(pDocument);
ScNotes::iterator itr = maNotes.begin();