Kaydet (Commit) 423df1fa authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: tdf#111428 implement CellStoreEvent::swap() in ScColumn::SwapCol()

CellStoreEvent remembered the original ScColumn* and corresponding
ScColumn::mnBlkCountFormula, hence after inserting a column to the
left the quick check of ScColumn::HasFormulaCell() whether there
are any formula cells worked on the swapped in column (originally
the one to the right) that happens to be empty in the scenario.
Things worked correctly by accident if the next column to the
right already contained a formula cell.

Regression from

    commit e57a5905
    Date:   Sat Jul 16 20:01:48 2016 -0400

Change-Id: If993856ceee657736f516a81c293506041a6b7eb
üst 5a325d96
......@@ -97,6 +97,8 @@ public:
void element_block_acquired(const mdds::mtv::base_element_block* block);
void element_block_released(const mdds::mtv::base_element_block* block);
void swap(CellStoreEvent& r);
};
/// Cell note container
......
......@@ -1895,6 +1895,10 @@ void ScColumn::SwapCol(ScColumn& rCol)
maCellTextAttrs.swap(rCol.maCellTextAttrs);
maCellNotes.swap(rCol.maCellNotes);
// Swap all CellStoreEvent mdds event_func related.
maCells.event_handler().swap( rCol.maCells.event_handler());
std::swap( mnBlkCountFormula, rCol.mnBlkCountFormula);
// notes update caption
UpdateNoteCaptions(0, MAXROW);
rCol.UpdateNoteCaptions(0, MAXROW);
......
......@@ -54,6 +54,11 @@ void CellStoreEvent::element_block_released(const mdds::mtv::base_element_block*
}
}
void CellStoreEvent::swap(CellStoreEvent& r)
{
std::swap( mpCol, r.mpCol);
}
ColumnBlockPositionSet::ColumnBlockPositionSet(ScDocument& rDoc) : mrDoc(rDoc) {}
ColumnBlockPosition* ColumnBlockPositionSet::getBlockPosition(SCTAB nTab, SCCOL nCol)
......
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