diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-07-31 18:39:36 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-19 10:18:22 +0200 |
commit | 695d995c3006a7125e5733b76347d327d137d3bd (patch) | |
tree | aecdf4bebfe3c2dc27133c5ca2f1a370f6bc0c56 /sw/source/core/layout/wsfrm.cxx | |
parent | c35696fa02acbef92790fa136a39dd0bb3732964 (diff) |
sw_redlinehide_2: show/hide footnotes in redlines
This requires some manual work to delete the footnote frames.
Change-Id: I2c5efccdd1e97f26e18402b809ca4f893147cba1
Diffstat (limited to 'sw/source/core/layout/wsfrm.cxx')
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index b12817a4760e..24f8e5cea971 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -4185,14 +4185,27 @@ static void UnHideRedlines(SwRootFrame & rLayout, rNode.GetRedlineMergeFlag() == SwNode::Merge::NonFirst); if (rNode.IsCreateFrameWhenHidingRedlines()) { - pFrame->SetMergedPara(CheckParaRedlineMerge(*pFrame, rTextNode)); + pFrame->SetMergedPara(CheckParaRedlineMerge(*pFrame, + rTextNode, sw::FrameMode::Existing)); // ??? TODO flys etc. } } else { - if (pFrame->GetMergedPara()) + if (auto const& pMergedPara = pFrame->GetMergedPara()) { + // the new text frames don't exist yet, so at this point + // we can only delete the footnote frames so they don't + // point to the merged SwTextFrame any more... + SwTextNode const* pNode(&rTextNode); + for (auto const& rExtent : pMergedPara->extents) + { + if (rExtent.pNode != pNode) + { + sw::RemoveFootnotesForNode(*pFrame, *rExtent.pNode, nullptr); + pNode = rExtent.pNode; + } + } pFrame->SetMergedPara(nullptr); // ??? TODO flys etc. // ??? TODO recreate? or is invalidate enough? @@ -4206,6 +4219,7 @@ static void UnHideRedlines(SwRootFrame & rLayout, { if (rNode.IsContentNode()) { + // note: no-op for NonFirst nodes, only Hidden will delete static_cast<SwContentNode&>(rNode).DelFrames(); // FIXME only those in this layout? } else if (rNode.IsTableNode()) |