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
if (redline.second.first)
{
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,
nStartIndex, nEndIndex, m_nPosition == redline.first))
{ // if current position is start of the redline, must skip!
......
......@@ -124,12 +124,32 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode,
}
pTmp->SetRedlineMergeFlag(SwNode::Merge::Hidden);
}
pNode = pEnd->nNode.GetNode().GetTextNode();
assert(pNode);
nodes.push_back(pNode);
pNode->SetRedlineMergeFlag(SwNode::Merge::NonFirst);
// note: in DelLastPara() case, the end node is not actually merged
// and is likely a SwTableNode!
if (!pEnd->nNode.GetNode().IsTextNode())
{
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)
{
......
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