Kaydet (Commit) 19f41fce authored tarafından Michael Stahl's avatar Michael Stahl

sw: fix ~SwIndexReg assert in DelFullPara() importing tdf108272-1.docx

The code in DelFullPara() returns early if it can't move the rPam
out of the to-be-deleted paragraph, but it only checks that the point
of the rPam is outside; it then rather pointlessly assigns the 0
index in the node where the mark is, which leaves the mark on the
to-be-deleted paragraph.

In this modern day and age, after much technological progress,
DeleteMark() actually does unregister its SwIndex, so just do that.

Change-Id: Ia1643cf0b976857809ee4130efdec37ce831fdef
üst 6565de2c
......@@ -1848,12 +1848,12 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam )
*rPam.GetPoint() = *aDelPam.GetPoint();
pUndo->SetPgBrkFlags( bSavePageBreak, bSavePageDesc );
m_rDoc.GetIDocumentUndoRedo().AppendUndo(pUndo);
rPam.DeleteMark();
}
else
{
SwNodeRange aRg( rStt.nNode, rEnd.nNode );
if( rPam.GetPoint() != &rEnd )
rPam.Exchange();
rPam.Normalize(false);
// Try to move past the End
if( !rPam.Move( fnMoveForward, GoInNode ) )
......@@ -1862,7 +1862,7 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam )
rPam.Exchange();
if( !rPam.Move( fnMoveBackward, GoInNode ))
{
OSL_FAIL( "no more Nodes" );
SAL_WARN("sw.core", "DelFullPara: no more Nodes");
return false;
}
}
......@@ -1895,13 +1895,9 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam )
}
}
SwContentNode *pTmpNode = rPam.GetBound().nNode.GetNode().GetContentNode();
rPam.GetBound().nContent.Assign( pTmpNode, 0 );
pTmpNode = rPam.GetBound( false ).nNode.GetNode().GetContentNode();
rPam.GetBound( false ).nContent.Assign( pTmpNode, 0 );
rPam.DeleteMark();
m_rDoc.GetNodes().Delete( aRg.aStart, nNodeDiff+1 );
}
rPam.DeleteMark();
m_rDoc.getIDocumentState().SetModified();
return true;
......
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