diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-06 17:51:46 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-19 10:18:31 +0200 |
commit | 28382b92ca917697a60aa228cbb416d9cca4bb98 (patch) | |
tree | ddf39893c380f0a902412a4722204612628e82cf /sw/source/core/text/redlnitr.cxx | |
parent | 3230baca58db9c78109a3c208afd7d19fe912f16 (diff) |
sw_redlinehide_2: do all frame deletion in CheckParaRedlineMerge()
Other callers need this too, particularly Undo, so move this into the
function so it's done once.
Change-Id: I58e89899127650157fe2889929c1c6b47c00649b
Diffstat (limited to 'sw/source/core/text/redlnitr.cxx')
-rw-r--r-- | sw/source/core/text/redlnitr.cxx | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index 26d1222128fb..b32ac32ac5f4 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -58,6 +58,8 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, } bool bHaveRedlines(false); std::vector<SwTextNode *> nodes{ &rTextNode }; + std::vector<SwTableNode *> tables; + std::vector<SwSectionNode *> sections; std::vector<sw::Extent> extents; OUStringBuffer mergedText; SwTextNode const* pParaPropsNode(nullptr); @@ -98,6 +100,21 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, for (sal_uLong j = pNode->GetIndex() + 1; j < pEnd->nNode.GetIndex(); ++j) { SwNode *const pTmp(pNode->GetNodes()[j]); + if (nLevel == 0) + { + if (pTmp->IsTextNode()) + { + nodes.push_back(pTmp->GetTextNode()); + } + else if (pTmp->IsTableNode()) + { + tables.push_back(pTmp->GetTableNode()); + } + else if (pTmp->IsSectionNode()) + { + sections.push_back(pTmp->GetSectionNode()); + } + } if (pTmp->IsStartNode()) { ++nLevel; @@ -106,10 +123,6 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, { --nLevel; } - else if (nLevel == 0 && pTmp->IsTextNode()) - { - nodes.push_back(pTmp->GetTextNode()); - } pTmp->SetRedlineMergeFlag(SwNode::Merge::Hidden); } pNode = pEnd->nNode.GetNode().GetTextNode(); @@ -184,6 +197,15 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, { (**iter).DelFrames(rFrame.getRootFrame()); } + // also delete tables & sections here; not necessary, but convenient + for (auto const pTableNode : tables) + { + pTableNode->DelFrames(rFrame.getRootFrame()); + } + for (auto const pSectionNode : sections) + { + pSectionNode->DelFrames(rFrame.getRootFrame()); + } } auto pRet(o3tl::make_unique<sw::MergedPara>(rFrame, std::move(extents), mergedText.makeStringAndClear(), pParaPropsNode, &rTextNode, |