[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
Eike Rathke
erack at redhat.com
Tue Apr 12 14:09:08 UTC 2016
sc/source/core/data/document.cxx | 36 +++++++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
New commits:
commit 7f4e1a22ed288ff9b257298f36d471b54a20bd72
Author: Eike Rathke <erack at redhat.com>
Date: Thu Apr 7 10:51:51 2016 +0100
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/23895
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 57d0ca5..8e57020 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1831,7 +1831,6 @@ void ScDocument::DeleteArea(
{
aRange.aStart.SetTab(i);
aRange.aEnd.SetTab(i);
-
SetDirty( aRange, true);
}
}
@@ -5722,6 +5721,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);
+ }
+ }
}
}
@@ -5763,6 +5777,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
More information about the Libreoffice-commits
mailing list