summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-06-08 13:29:22 +0200
committerEike Rathke <erack@redhat.com>2015-06-08 13:35:20 +0200
commite141806955a2a3231a0c43519bbfcf8bc65fc5cd (patch)
tree68a10cc00b431bea2ec10a9ad0487cbcbe34c0eb /sc
parent670f78ee3c89434d965970f6220eff811bc8b7ab (diff)
tdf#90694 reset group area listeners on correct top
Follow-up on 2f6a06856ad8df0c11a112d1e457b408e9a7af1d, rTop is top of created group, listening needs to be ended on original (previous) group. Change-Id: I1f975a0a6c85e649aa07ce5c6e97bc6e917ff9ce (cherry picked from commit 5d6448a5131488eac3a6af16bff06140663c3db4)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/sharedformula.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sc/source/core/tool/sharedformula.cxx b/sc/source/core/tool/sharedformula.cxx
index c21b31ec2c81..a3fd1aeea926 100644
--- a/sc/source/core/tool/sharedformula.cxx
+++ b/sc/source/core/tool/sharedformula.cxx
@@ -52,24 +52,25 @@ void SharedFormulaUtil::splitFormulaCellGroup(const CellStoreType::position_type
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
// 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
// other listeners, all listeners of this group's top cell are to be reset.
if (nLength2)
{
- rTop.EndListeningTo( rTop.GetDocument(), NULL, ScAddress( ScAddress::UNINITIALIZED));
- rTop.SetNeedsListening(true);
+ rPrevTop.EndListeningTo( rPrevTop.GetDocument(), NULL, ScAddress( ScAddress::UNINITIALIZED));
+ rPrevTop.SetNeedsListening(true);
}
#endif
- xGroup->mnLength = nRow - xGroup->mpTopCell->aPos.Row();
if (xGroup->mnLength == 1)
{
// The top group consists of only one cell. Ungroup this.
ScFormulaCellGroupRef xNone;
- ScFormulaCell& rPrev = *sc::formula_block::at(*aPos.first->data, aPos.second-1);
- rPrev.SetCellGroup(xNone);
+ rPrevTop.SetCellGroup(xNone);
}
// Apply the lower group object to the lower cells.