diff options
author | Eike Rathke <erack@redhat.com> | 2017-08-24 19:33:32 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-08-24 19:34:22 +0200 |
commit | c84332184a5de3e4180514cf6e3282597ffe5dd6 (patch) | |
tree | 4bda1a10014a50423449cfdede5d603ea77a03bb | |
parent | 39c08074a286855dd014ce1c30b8f7ef95b10242 (diff) |
Resolves: tdf#93171 follow-up, notify dependents of subtotal formula cells
Track ScHiddenRowsChanged collected cells and broadcast with ScDataChanged.
Change-Id: Id41d2731585f6749533319bf42ad655a845ecf30
-rw-r--r-- | sc/source/core/data/documen7.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/table5.cxx | 15 |
2 files changed, 14 insertions, 4 deletions
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index 342fff0c5664..299f5e70d089 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -559,7 +559,8 @@ void ScDocument::TrackFormulas( SfxHintId nHintId ) if (!pBASM) return; - if (pBASM->IsInBulkBroadcast() && !IsFinalTrackFormulas() && nHintId == SfxHintId::ScDataChanged) + if (pBASM->IsInBulkBroadcast() && !IsFinalTrackFormulas() && + (nHintId == SfxHintId::ScDataChanged || nHintId == SfxHintId::ScHiddenRowsChanged)) { SetTrackFormulasPending(); return; diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index f64e2dc865f1..d6c7a8527e4b 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -40,6 +40,7 @@ #include "globalnames.hxx" #include "scmod.hxx" #include "printopt.hxx" +#include "bcaslot.hxx" #include <com/sun/star/sheet/TablePageBreakData.hpp> @@ -593,9 +594,17 @@ bool ScTable::SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden) { if (IsStreamValid()) SetStreamValid(false); - for (SCCOL i = 0; i < aCol.size(); i++) - { - aCol[i].BroadcastRows(nStartRow, nEndRow, SfxHintId::ScHiddenRowsChanged); + + { // Scoped bulk broadcast. + // Only subtotal formula cells will accept the notification of + // SfxHintId::ScHiddenRowsChanged, leaving the bulk will track + // those and broadcast SfxHintId::ScDataChanged to notify all + // dependents. + ScBulkBroadcast aBulkBroadcast( pDocument->GetBASM(), SfxHintId::ScDataChanged); + for (SCCOL i = 0; i < aCol.size(); i++) + { + aCol[i].BroadcastRows(nStartRow, nEndRow, SfxHintId::ScHiddenRowsChanged); + } } } |