diff options
Diffstat (limited to 'sw/source/core/undo/undel.cxx')
-rw-r--r-- | sw/source/core/undo/undel.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 0750062cfb47..677300380151 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -884,7 +884,17 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) if( m_aEndStr ) { // discard attributes since they all saved! - SwTextNode* pTextNd = aPos.nNode.GetNode().GetTextNode(); + SwTextNode * pTextNd; + if (!m_bDelFullPara && aPos.nNode.GetNode().IsSectionNode()) + { // tdf#134250 section node wasn't deleted; but aPos must point to it in bNodeMove case below + assert(m_nSttContent == 0); + assert(!m_aSttStr); + pTextNd = rDoc.GetNodes()[aPos.nNode.GetIndex() + 1]->GetTextNode(); + } + else + { + pTextNd = aPos.nNode.GetNode().GetTextNode(); + } if( pTextNd && pTextNd->HasSwAttrSet() ) pTextNd->ResetAllAttr(); @@ -904,6 +914,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) lcl_ReAnchorAtContentFlyFrames(*rDoc.GetSpzFrameFormats(), aPos, nOldIdx); pTextNd = aPos.nNode.GetNode().GetTextNode(); } + assert(pTextNd); // else where does m_aEndStr come from? if( pTextNd ) { OUString const ins( pTextNd->InsertText(*m_aEndStr, aPos.nContent, |