[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 1 09:20:01 UTC 2021


 sw/source/core/doc/DocumentRedlineManager.cxx |    2 ++
 sw/source/core/text/txtfrm.cxx                |    2 ++
 2 files changed, 4 insertions(+)

New commits:
commit 2b95e286c1091252d87720d106a50eeb65dceb00
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Thu Jan 14 20:10:24 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Tue Jun 1 11:19:25 2021 +0200

    tdf#135014 sw_redlinehide: fix missing frames when removing fieldmark
    
    A fieldmark was deleted. UpdateFramesForRemoveDeleteRedline() deleted
    the MergedPara but its start node was before the start node of the
    fieldmark, and then MakeFrames() didn't find a frame on the preceding
    node and did nothing.
    
    Similar problem likely possible with redline.
    
    Change-Id: I532f9a67c0268f3287736a61da4cc9fefec7b8e4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109307
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit 32e104c1d6be0ffe6ed6c4e08af868c87b3c258c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115938
    Tested-by: Michael Stahl <michael.stahl at allotropia.de>

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index f97d43a1e3af..335b135b1a3a 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -305,6 +305,8 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam)
                     pFrame->SetMergedPara(sw::CheckParaRedlineMerge(
                         *pFrame, rFirstNode, eMode));
                     eMode = sw::FrameMode::New; // Existing is not idempotent!
+                    // update pNode so MakeFrames starts on 2nd node
+                    pNode = &rFirstNode;
                 }
             }
             if (pLast != pNode)
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index ea75eba6d012..f0449c585f03 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1226,6 +1226,8 @@ void SwTextFrame::SetMergedPara(std::unique_ptr<sw::MergedPara> p)
             pFirst->Add(this); // must register at node again
         }
     }
+    // postcondition: frame must be listening somewhere
+    assert(m_pMergedPara || GetDep());
 }
 
 const OUString& SwTextFrame::GetText() const


More information about the Libreoffice-commits mailing list