Kaydet (Commit) 5d6448a5 authored tarafından Eike Rathke's avatar Eike Rathke

tdf#90694 reset group area listeners on correct top

Follow-up on 2f6a0685, rTop is top of
created group, listening needs to be ended on original (previous) group.

Change-Id: I1f975a0a6c85e649aa07ce5c6e97bc6e917ff9ce
üst 15feadfb
...@@ -52,24 +52,25 @@ void SharedFormulaUtil::splitFormulaCellGroup(const CellStoreType::position_type ...@@ -52,24 +52,25 @@ void SharedFormulaUtil::splitFormulaCellGroup(const CellStoreType::position_type
xGroup2->mpCode = xGroup->mpCode->Clone(); xGroup2->mpCode = xGroup->mpCode->Clone();
} }
xGroup->mnLength = nRow - xGroup->mpTopCell->aPos.Row();
ScFormulaCell& rPrevTop = *sc::formula_block::at(*aPos.first->data, aPos.second - xGroup->mnLength);
#if USE_FORMULA_GROUP_LISTENER #if USE_FORMULA_GROUP_LISTENER
// At least group area listeners will have to be adapted. As long as // At least group area listeners will have to be adapted. As long as
// there's no update mechanism and no separated handling of group area and // there's no update mechanism and no separated handling of group area and
// other listeners, all listeners of this group's top cell are to be reset. // other listeners, all listeners of this group's top cell are to be reset.
if (nLength2) if (nLength2)
{ {
rTop.EndListeningTo( rTop.GetDocument(), NULL, ScAddress( ScAddress::UNINITIALIZED)); rPrevTop.EndListeningTo( rPrevTop.GetDocument(), NULL, ScAddress( ScAddress::UNINITIALIZED));
rTop.SetNeedsListening(true); rPrevTop.SetNeedsListening(true);
} }
#endif #endif
xGroup->mnLength = nRow - xGroup->mpTopCell->aPos.Row();
if (xGroup->mnLength == 1) if (xGroup->mnLength == 1)
{ {
// The top group consists of only one cell. Ungroup this. // The top group consists of only one cell. Ungroup this.
ScFormulaCellGroupRef xNone; ScFormulaCellGroupRef xNone;
ScFormulaCell& rPrev = *sc::formula_block::at(*aPos.first->data, aPos.second-1); rPrevTop.SetCellGroup(xNone);
rPrev.SetCellGroup(xNone);
} }
// Apply the lower group object to the lower cells. // Apply the lower group object to the lower cells.
......
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