Kaydet (Commit) 5f982c22 authored tarafından Michael Stahl's avatar Michael Stahl

SwUndoSplitTbl::UndoImpl(): avoid assert from ~SwIndexReg

Can be triggered by moving view cursor into new paragraph before Undo.

Change-Id: I8386611a8eabd1c3b6edfacd0226358df52cbe66
üst bc0c9392
...@@ -2873,12 +2873,23 @@ void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -2873,12 +2873,23 @@ void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext)
SwDoc *const pDoc = & rContext.GetDoc(); SwDoc *const pDoc = & rContext.GetDoc();
SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
SwNodeIndex& rIdx = pPam->GetPoint()->nNode; SwNodeIndex& rIdx = pPam->GetPoint()->nNode;
rIdx = nTblNode + nOffset; rIdx = nTblNode + nOffset;
pPam->GetPoint()->nContent.Assign(rIdx.GetNode().GetCntntNode(), 0);
assert(rIdx.GetNode().GetCntntNode()->Len() == 0); // empty para inserted
{
// avoid asserts from ~SwIndexReg
SwNodeIndex const idx(pDoc->GetNodes(), nTblNode + nOffset);
{
SwPaM pam(idx);
pam.Move(fnMoveBackward, fnGoCntnt);
::PaMCorrAbs(*pPam, *pam.GetPoint());
}
// remove implicitly created paragraph again // remove implicitly created paragraph again
pDoc->GetNodes().Delete( rIdx, 1 ); pDoc->GetNodes().Delete( idx, 1 );
}
rIdx = nTblNode + nOffset; rIdx = nTblNode + nOffset;
SwTableNode* pTblNd = rIdx.GetNode().GetTableNode(); SwTableNode* pTblNd = rIdx.GetNode().GetTableNode();
......
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