From 258fe9d266e27a8211274ed5d11ec7558cdf7ace Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 14 Jan 2021 20:10:24 +0100 Subject: tdf#135014 sw_redlinehide: fix missing frames when removing fieldmark MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 32e104c1d6be0ffe6ed6c4e08af868c87b3c258c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109347 Reviewed-by: Caolán McNamara --- sw/source/core/doc/DocumentRedlineManager.cxx | 2 ++ sw/source/core/text/txtfrm.cxx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index ff9b05743d10..8ae32f266bdb 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -301,6 +301,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 f6927730edc6..46957b4448f8 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -1292,6 +1292,8 @@ void SwTextFrame::SetMergedPara(std::unique_ptr p) pFirst->Add(this); // must register at node again } } + // postcondition: frame must be listening somewhere + assert(m_pMergedPara || GetDep()); } const OUString& SwTextFrame::GetText() const -- cgit