Kaydet (Commit) 8af496c9 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide_4b: fix wrong handling of IsDelLastPara() redlines

CheckParaRedlineMerge(): Fully deleted SwTextNode followed by a table,
as seen in ooo81405-1.odt and ooo31961-16.sxw.

Also avoid creating an extent for the node in which it starts,
e.g. ooo31961-27.odt.

Change-Id: I2a7d935a9cedcb66aeaa9dce418b1fab758f1784
üst 9b67b6a6
...@@ -740,6 +740,8 @@ TextFrameIndex SwAttrIter::GetNextAttr() const ...@@ -740,6 +740,8 @@ TextFrameIndex SwAttrIter::GetNextAttr() const
if (redline.second.first) if (redline.second.first)
{ {
assert(m_pMergedPara); assert(m_pMergedPara);
assert(redline.second.first->End()->nNode.GetIndex() <= m_pMergedPara->pLastNode->GetIndex()
|| !redline.second.first->End()->nNode.GetNode().IsTextNode());
if (CanSkipOverRedline(*redline.second.first, if (CanSkipOverRedline(*redline.second.first,
nStartIndex, nEndIndex, m_nPosition == redline.first)) nStartIndex, nEndIndex, m_nPosition == redline.first))
{ // if current position is start of the redline, must skip! { // if current position is start of the redline, must skip!
......
...@@ -124,12 +124,32 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, ...@@ -124,12 +124,32 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode,
} }
pTmp->SetRedlineMergeFlag(SwNode::Merge::Hidden); pTmp->SetRedlineMergeFlag(SwNode::Merge::Hidden);
} }
pNode = pEnd->nNode.GetNode().GetTextNode(); // note: in DelLastPara() case, the end node is not actually merged
assert(pNode); // and is likely a SwTableNode!
nodes.push_back(pNode); if (!pEnd->nNode.GetNode().IsTextNode())
pNode->SetRedlineMergeFlag(SwNode::Merge::NonFirst); {
assert(pEnd->nNode != pStart->nNode);
// must set pNode too because it will mark the last node
pNode = nodes.back();
assert(pNode == pNode->GetNodes()[pEnd->nNode.GetIndex() - 1]);
if (pNode != &rTextNode)
{ // something might depend on last merged one being NonFirst?
pNode->SetRedlineMergeFlag(SwNode::Merge::NonFirst);
}
nLastEnd = pNode->Len();
}
else
{
pNode = pEnd->nNode.GetNode().GetTextNode();
nodes.push_back(pNode);
pNode->SetRedlineMergeFlag(SwNode::Merge::NonFirst);
nLastEnd = pEnd->nContent.GetIndex();
}
}
else
{
nLastEnd = pEnd->nContent.GetIndex();
} }
nLastEnd = pEnd->nContent.GetIndex();
} }
if (pNode == &rTextNode) if (pNode == &rTextNode)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment