diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-09-26 21:40:13 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-09-26 22:02:49 +0200 |
commit | 19f41fce02b83e9a076b5f97c22b5a8926fb6144 (patch) | |
tree | fcbf20cbf6b0d1a217abd3bc8a1713f833e6fb9d | |
parent | 6565de2c88aeeb2a8130fa65ae55b15cc7b8b2ca (diff) |
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
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index ff1e4586d0df..4d72d883e8fe 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -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; |