sc/source/core/data/column3.cxx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
New commits: commit 6160025b27e97841321be29863bb1efd8c194a5f Author: Eike Rathke <er...@redhat.com> AuthorDate: Fri Mar 15 13:25:32 2019 +0100 Commit: Eike Rathke <er...@redhat.com> CommitDate: Fri Mar 15 15:22:42 2019 +0100 In case of sc::NoListening only SetNeedsListeningGroup(), tdf#123736 follow-up Change-Id: I3e5a5334dfe11002b526f942463626b62efbc340 Reviewed-on: https://gerrit.libreoffice.org/69303 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 2607ea4b74a8..1d69e3515e1a 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -507,13 +507,27 @@ void ScColumn::AttachNewFormulaCell( break; case sc::SingleCellListening: rCell.StartListeningTo(pDocument); - [[fallthrough]]; + StartListeningUnshared( rNewSharedRows); + break; case sc::NoListening: default: - // Listeners for changed shared formula groups resulting from - // unshareFormulaCell() need to be re-established in all cases - // (unless the callers thought of that and take care of it, but..). - StartListeningUnshared( rNewSharedRows); + if (!rNewSharedRows.empty()) + { + assert(rNewSharedRows.size() == 2 || rNewSharedRows.size() == 4); + // Calling SetNeedsListeningGroup() with a top row sets it to + // all affected formula cells of that group. + const ScFormulaCell* pFC = GetFormulaCell( rNewSharedRows[0]); + assert(pFC); // that *is* supposed to be a top row + if (pFC && !pFC->NeedsListening()) + SetNeedsListeningGroup( rNewSharedRows[0]); + if (rNewSharedRows.size() > 2) + { + pFC = GetFormulaCell( rNewSharedRows[2]); + assert(pFC); // that *is* supposed to be a top row + if (pFC && !pFC->NeedsListening()) + SetNeedsListeningGroup( rNewSharedRows[2]); + } + } break; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits