From 52f4baffb875232f155874a63e383da436c10bff Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 13 Dec 2018 13:09:06 +0100 Subject: sw_redlinehide_4b: fix InsertCnt_() iteration of hidden tables The iteration was stopped as soon as the first start-node of a table cell was reached, because the SwTableNode case didn't skip over the table section in the nodes-array. As seen in ooo67621-1.odt. It looks like the same problem can't happen with sections or flys because only tables have nested SwStartNodes and the Fly's nodes can hardly all be in a delete redline. Change-Id: Ib21a758c588d5dc8193ba171353f872de71bd65a --- sw/source/core/layout/frmtool.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sw/source') diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index dda68bc72473..4cf8effa38e2 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1475,6 +1475,7 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, if (pLayout->IsHideRedlines() && !pNd->IsCreateFrameWhenHidingRedlines()) { assert(pNd->GetRedlineMergeFlag() == SwNode::Merge::Hidden); + nIndex = pTableNode->EndOfSectionIndex(); continue; // skip it } @@ -1700,6 +1701,7 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, if (pLayout->IsHideRedlines() && !pNd->IsCreateFrameWhenHidingRedlines()) { assert(pNd->GetRedlineMergeFlag() == SwNode::Merge::Hidden); + assert(false); // actually a fly-section can't be deleted? continue; // skip it } if ( !pTable->empty() && bObjsDirect && !bDontCreateObjects ) @@ -1710,8 +1712,12 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, } } else + { + assert(!pLayout->IsHideRedlines() + || pNd->GetRedlineMergeFlag() != SwNode::Merge::Hidden); // Neither Content nor table nor section, so we are done. break; + } } if ( pActualSection ) -- cgit v1.2.3