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 <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 491e8f60bf7f216a3bb3092b22334924b6c9aee1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85353
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 18132d2..a889452 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2156,6 +2156,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 );
@@ -2171,6 +2172,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())
        {
@@ -2182,7 +2192,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(