summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-04-07 10:51:51 +0100
committerEike Rathke <erack@redhat.com>2016-04-07 10:59:03 +0100
commit94a95dce43e07b40350ed849db148b2946e3fd5e (patch)
tree710418821f9a8cf473fb7e0d6886011bd5056131
parentc5e119f51bd07fb11ac04a58dacf3f79695d02a9 (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
-rw-r--r--sc/source/core/data/document.cxx36
1 files changed, 35 insertions, 1 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 67a882ab824a..605cf2e640f1 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1839,7 +1839,6 @@ void ScDocument::DeleteArea(
{
aRange.aStart.SetTab(i);
aRange.aEnd.SetTab(i);
-
SetDirty( aRange, true);
}
}
@@ -5788,6 +5787,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);
+ }
+ }
}
}
@@ -5829,6 +5843,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