diff options
author | Eike Rathke <erack@redhat.com> | 2016-04-07 10:51:51 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-12 14:08:30 +0000 |
commit | 1345cea38ecb51655375e77f5aa77aa9461d240b (patch) | |
tree | 7ed9f4de7e3006c781b1f2abeafe7275f575662f | |
parent | 95c9d125df7c1c3fe6400cf51f5b4ca9b91c8834 (diff) |
Resolves: tdf#97897 (re)broadcast if formula groups were split
DeleteSelection() and DeleteSelectionTab() remove listeners for split
formula groups, broadcast change after listeners of new groups have been
established.
Change-Id: I017e92b5cbc5f866768f3732e9997028c0c065fa
(cherry picked from commit 94a95dce43e07b40350ed849db148b2946e3fd5e)
Reviewed-on: https://gerrit.libreoffice.org/23894
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sc/source/core/data/document.cxx | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 138cb0790af0..69059b5338c4 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1830,7 +1830,6 @@ void ScDocument::DeleteArea( { aRange.aStart.SetTab(i); aRange.aEnd.SetTab(i); - SetDirty( aRange, true); } } @@ -5717,6 +5716,21 @@ void ScDocument::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& // Re-start listeners on those top bottom groups that have been split. SetNeedsListeningGroups(aGroupPos); StartNeededListeners(); + + // If formula groups were split their listeners were destroyed and may + // need to be notified now that they're restored, + // ScTable::DeleteSelection() couldn't do that. + if (!aGroupPos.empty()) + { + ScRangeList aRangeList; + rMark.FillRangeListWithMarks( &aRangeList, false); + for (size_t i = 0; i < aRangeList.size(); ++i) + { + const ScRange* pRange = aRangeList[i]; + if (pRange) + SetDirty( *pRange, true); + } + } } } @@ -5758,6 +5772,26 @@ void ScDocument::DeleteSelectionTab( // Re-start listeners on those top bottom groups that have been split. SetNeedsListeningGroups(aGroupPos); StartNeededListeners(); + + // If formula groups were split their listeners were destroyed and may + // need to be notified now that they're restored, + // ScTable::DeleteSelection() couldn't do that. + if (!aGroupPos.empty()) + { + ScRangeList aRangeList; + rMark.FillRangeListWithMarks( &aRangeList, false); + for (size_t i = 0; i < aRangeList.size(); ++i) + { + const ScRange* pRange = aRangeList[i]; + if (pRange && pRange->aStart.Tab() <= nTab && nTab <= pRange->aEnd.Tab()) + { + ScRange aRange( *pRange); + aRange.aStart.SetTab( nTab); + aRange.aEnd.SetTab( nTab); + SetDirty( aRange, true); + } + } + } } } else |