tdf#147938 sw_redlinehide: move fix into SwNodes::UndoTableOfText()

Reproducing tdf#151866 on the .odt attachment, it becomes clear that the
fix for tdf#147938 is in the wrong place.

There a node has the merge flag None although it is the last node of a
merge, because CheckParaRedlineMerge() first sets the node flags and
then calls DelFrames(), which now resets the flags.

In case there's another caller of DelFrames() that needs this, it's not
obvious, can be added later.

(regression from commit 5b55ccfd384d3c0c11e05f22bd7e956b4bc7e43a)

Change-Id: Iba0cb83260ecb18a4b96ded20a95b2b20d696fc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155516
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 06a9496..64a9e86 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1506,15 +1506,6 @@ void SwContentNode::DelFrames(SwRootFrame const*const pLayout)
                    pMerged->listener.EndListening(this);
                    continue; // don't delete
                }
                else
                {
                    for (SwNodeOffset i = pMerged->pLastNode->GetIndex();
                         GetIndex() <= i; --i)
                    {   // tdf#147938 reset flag in nodes
                        SwNode *const pNode = GetNodes()[i];
                        pNode->SetRedlineMergeFlag(SwNode::Merge::None);
                    }
                }
            }
        // #i27138#
        // notify accessibility paragraphs objects about changed
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index d6e58e6..3092df0 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -548,8 +548,13 @@ SwTableNode* SwNodes::UndoTableToText( SwNodeOffset nSttNd, SwNodeOffset nEndNd,
        SwNodeOffset n, nTmpEnd = aEndIdx.GetIndex();
        for( n = pTableNd->GetIndex() + 1; n < nTmpEnd; ++n )
        {
            if( ( pNd = (*this)[ n ] )->IsContentNode() )
            pNd = (*this)[n];
            if (pNd->IsContentNode())
            {
                static_cast<SwContentNode*>(pNd)->DelFrames(nullptr);
            }
            // tdf#147938 reset merge flag in nodes
            pNd->SetRedlineMergeFlag(SwNode::Merge::None);
            pNd->m_pStartOfSection = pTableNd;
        }
    }