diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-12-11 14:45:01 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-12-17 18:04:07 +0100 |
commit | e843b8571dcc6d6b5920bccbe06fe671650cb33c (patch) | |
tree | 24fb260b4c68a2529b4947fafd15ede2816d1c5e /sw/source/core/txtnode | |
parent | a92411b1abfde9a45551055f89addd352d52ebba (diff) |
sw_redlinehide_4b: FrameMode::Existing is not idempotent
... so use it only once. The problem is that the second time it will
call DelFrames() on every non-first node, which then empties the first
frame's newly created MergedPara instance.
This can be reproduced by toggling Edit->Tracked Changes->Show in
tdf99766-2.odt.
Also change some function parameters on e.g. SwTextFootnote::DelFrames()
to SwRootFrame to make it obvious that these don't actually need a
particular SwTextFrame.
Change-Id: I129be5db4a30546905c24c5e8820a5f105a33109
Diffstat (limited to 'sw/source/core/txtnode')
-rw-r--r-- | sw/source/core/txtnode/atrftn.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index e1a849b35d2c..81afed72030b 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -445,14 +445,13 @@ void SwTextFootnote::MakeNewTextSection( SwNodes& rNodes ) m_pStartNode.reset(new SwNodeIndex(*pSttNd)); } -void SwTextFootnote::DelFrames( const SwFrame* pSib ) +void SwTextFootnote::DelFrames(SwRootFrame const*const pRoot) { // delete the FootnoteFrames from the pages OSL_ENSURE( m_pTextNode, "SwTextFootnote: where is my TextNode?" ); if ( !m_pTextNode ) return; - const SwRootFrame* pRoot = pSib ? pSib->getRootFrame() : nullptr; bool bFrameFnd = false; { SwIterator<SwContentFrame, SwTextNode, sw::IteratorMode::UnwrapMulti> aIter(*m_pTextNode); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index e1df1ea4dea9..2db52f511bbc 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -911,6 +911,7 @@ void CheckResetRedlineMergeFlag(SwTextNode & rNode, Recreate const eRecreateMerg frames.push_back(pFrame); } } + auto eMode(sw::FrameMode::Existing); for (SwTextFrame * pFrame : frames) { SwTextNode & rFirstNode(pFrame->GetMergedPara() @@ -918,10 +919,11 @@ void CheckResetRedlineMergeFlag(SwTextNode & rNode, Recreate const eRecreateMerg : *pMergeNode); assert(rFirstNode.GetIndex() <= rNode.GetIndex()); pFrame->SetMergedPara(sw::CheckParaRedlineMerge( - *pFrame, rFirstNode, sw::FrameMode::Existing)); + *pFrame, rFirstNode, eMode)); assert(pFrame->GetMergedPara()); assert(pFrame->GetMergedPara()->listener.IsListeningTo(&rNode)); assert(rNode.GetIndex() <= pFrame->GetMergedPara()->pLastNode->GetIndex()); + eMode = sw::FrameMode::New; // Existing is not idempotent! } } else if (rNode.GetRedlineMergeFlag() != SwNode::Merge::None) |