summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/undo/undel.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 739597cf6fce..d225d1eb2868 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -856,6 +856,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
SwPosition aPos( aIdx );
if( !m_bDelFullPara )
{
+ assert(!m_bTableDelLastNd || pInsNd->IsTextNode());
if( pInsNd->IsTableNode() )
{
pInsNd = rDoc.GetNodes().MakeTextNode( aIdx,
@@ -1042,8 +1043,11 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
}
}
// delete the temporarily added Node
- if( pInsNd )
+ if (pInsNd && !m_bTableDelLastNd)
+ {
+ assert(&aIdx.GetNode() == pInsNd);
rDoc.GetNodes().Delete( aIdx );
+ }
if( m_pRedlSaveData )
SetSaveData(rDoc, *m_pRedlSaveData);
@@ -1135,6 +1139,15 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
lcl_MakeAutoFrames(*rDoc.GetSpzFrameFormats(), pMovedNode->GetIndex());
}
+ // tdf#134021 only after MakeFrames(), because it may be the only node
+ // that has layout frames
+ if (pInsNd && m_bTableDelLastNd)
+ {
+ assert(&aIdx.GetNode() == pInsNd);
+ SwPaM tmp(aIdx, aIdx);
+ rDoc.getIDocumentContentOperations().DelFullPara(tmp);
+ }
+
AddUndoRedoPaM(rContext, true);
}