sc/source/core/data/column.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
New commits: commit 35f82ef89071887726f6cb125cc669dd51a3db47 Author: Eike Rathke <er...@redhat.com> AuthorDate: Tue Dec 17 23:51:54 2019 +0100 Commit: Xisco Faulí <xiscofa...@libreoffice.org> CommitDate: Wed Dec 18 09:31:54 2019 +0100 Resolves: tdf#129396 Refresh shared formula group area listeners upon shifting Regression from commit 47230a036fe35b9a7a7c0609232849fcbb51efcc CommitDate: Thu Feb 5 11:52:51 2015 +0100 Resolves: tdf#88792 do not hold a ScFormulaCell** in group area listener where previously the listener position's column was taken from the group's remembered top formula cell (then updated) position, which holding the cell was wrong in other cases. Change-Id: Ida1503daa7cbda2b41459ff5d63652a6febd91e0 Reviewed-on: https://gerrit.libreoffice.org/85347 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins (cherry picked from commit 491e8f60bf7f216a3bb3092b22334924b6c9aee1) Reviewed-on: https://gerrit.libreoffice.org/85352 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index d1b10c128344..ebcc7dfa2248 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -2157,6 +2157,7 @@ class UpdateRefOnNonCopy // Run this before the position gets updated. sc::RefUpdateResult aRes = pCode->AdjustReferenceOnShift(*mpCxt, aOldPos); + bool bGroupShifted = false; if (pTop->UpdatePosOnShift(*mpCxt)) { ScAddress aErrorPos( ScAddress::UNINITIALIZED ); @@ -2172,6 +2173,15 @@ class UpdateRefOnNonCopy if (pCode->IsRecalcModeOnRefMove()) aRes.mbValueChanged = true; + + // FormulaGroupAreaListener (contrary to ScBroadcastArea) is not + // updated but needs to be re-setup, else at least its mpColumn + // would indicate the old column to collect cells from. tdf#129396 + /* TODO: investigate if that could be short-cut to avoid all the + * EndListeningTo() / StartListeningTo() overhead and is really + * only necessary when shifting the column, not also when shifting + * rows. */ + bGroupShifted = true; } else if (aRes.mbReferenceModified && pCode->IsRecalcModeOnRefMove()) { @@ -2183,7 +2193,7 @@ class UpdateRefOnNonCopy if (aRes.mbNameModified) recompileTokenArray(*pTop); - if (aRes.mbReferenceModified || aRes.mbNameModified) + if (aRes.mbReferenceModified || aRes.mbNameModified || bGroupShifted) { sc::EndListeningContext aEndCxt(mpCxt->mrDoc, pOldCode.get()); aEndCxt.setPositionDelta( _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits