sw/source/core/docnode/node.cxx |    9 ---------
 sw/source/core/undo/untbl.cxx   |    7 ++++++-
 2 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit b5a41467efdce02b80ffe3824fdefe9fbc01fc95
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Aug 9 13:42:33 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Aug 9 16:25:47 2023 +0200

    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.st...@allotropia.de>

diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 06a949609d91..64a9e86137c5 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 d6e58e633844..3092df0c2fd3 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;
         }
     }

Reply via email to