summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-03-18 20:59:36 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-03-19 08:08:14 +0100
commite782937228479054336b564a4c34697a12530469 (patch)
treeb25ae1611882df66059fc3b0cb45829c711fd41a /sw
parent4550b35781c6d9407da29f64f9b02b9201bf953b (diff)
Related: tdf#133933 sw: fix assertion failure in the SwIndexReg dtor
Make sure that by the time we delete a text node, no SwIndexes point to us. Change-Id: I9248a2ebe529e5a0aab0e37bf676e669b9bddb1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112698 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/inc/UndoTable.hxx2
-rw-r--r--sw/source/core/undo/untbl.cxx8
2 files changed, 7 insertions, 3 deletions
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 15bb1dc85bea..472f9fdd65d5 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -273,7 +273,7 @@ class SwUndoTableCpyTable : public SwUndo
//b6341295: When redlining is active, PrepareRedline has to create the
//redlining attributes for the new and the old table cell content
static std::unique_ptr<SwUndo> PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox,
- const SwPosition& rPos, bool& rJoin, bool bRedo );
+ SwPosition& rPos, bool& rJoin, bool bRedo );
public:
SwUndoTableCpyTable(const SwDoc& rDoc);
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index b15a8db09331..fdc8b25b0631 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2493,7 +2493,7 @@ void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext)
// Otherwise aInsIdx has been moved during the Undo operation
if( pEntry->bJoin )
{
- SwPaM const& rLastPam =
+ SwPaM& rLastPam =
rContext.GetCursorSupplier().GetCurrentShellCursor();
pUndo = PrepareRedline( &rDoc, rBox, *rLastPam.GetPoint(),
pEntry->bJoin, true );
@@ -2608,7 +2608,7 @@ void SwUndoTableCpyTable::AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex
// rJoin is true if Redo() is calling and the content has already been merged
std::unique_ptr<SwUndo> SwUndoTableCpyTable::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox,
- const SwPosition& rPos, bool& rJoin, bool bRedo )
+ SwPosition& rPos, bool& rJoin, bool bRedo )
{
std::unique_ptr<SwUndo> pUndo;
// b62341295: Redline for copying tables
@@ -2632,6 +2632,10 @@ std::unique_ptr<SwUndo> SwUndoTableCpyTable::PrepareRedline( SwDoc* pDoc, const
if( !bRedo && rPos.nNode.GetNode().GetTextNode() )
{ // Try to merge, if not called by Redo()
rJoin = true;
+
+ // Park this somewhere else so nothing points to the to-be-deleted node.
+ rPos.nContent.Assign(pText, 0);
+
pText->JoinNext();
}
}