diff options
author | Eike Rathke <erack@redhat.com> | 2017-08-24 19:33:32 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2017-09-15 21:50:44 +0200 |
commit | de4a0f769501b0b79b05e007ae340af344017dd0 (patch) | |
tree | ad1b7dc4c7cdee47047f03622b4453d3e991fda5 /sc | |
parent | 159f55eab59d5a01973e5ea79f9109d25e5dac31 (diff) |
Resolves: tdf#93171 follow-up, notify dependents of subtotal formula cells
Track ScHiddenRowsChanged collected cells and broadcast with ScDataChanged.
Change-Id: Id41d2731585f6749533319bf42ad655a845ecf30
(cherry picked from commit c84332184a5de3e4180514cf6e3282597ffe5dd6)
Reviewed-on: https://gerrit.libreoffice.org/41530
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sc')
-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 8ab7e6014266..913b9cf0c055 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 81ad0057e68b..d65632536262 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); + } } } |