summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-07-14 14:44:59 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-07-14 20:27:11 +0200
commit4270552395600487f9d680cfdc9cd0ad6f457497 (patch)
treee95c836eba136b03df5a5d0a120bedbf801a1778
parentb573006f3d268d3e31c9b4f740ff4d0ad92a2371 (diff)
tdf#156267 sw: remove DdeBookmarks in SwDoc::DelTable()
On Copy, a SwTransferDdeLink is created, which also creates a DDE_BOOKMARK (it's the only thing that does that) without Undo. On Delete, the DelTable() creates SwUndoDelete which creates a SwHistoryBookmark; then the DeleteAndJoin() deletes the DdeBookmark. On Undo, the SwHistoryBookmark doesn't find its bookmark, and crashes. Because the DdeBookmark is artificial and deliberately created without Undo, DelTable() should prevent the SwHistoryBookmark by deleting it first. (regression from commit d81379db730a163c5ff75d4f3a3cddbd7b5eddda) Change-Id: Ib24c788a49a6fee364b44a1dbc8d53870c074596 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154440 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/source/core/docnode/ndtbl.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 08775066cb91..cd6358ea0ecf 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1917,6 +1917,11 @@ void SwDoc::DeleteCol( const SwCursor& rCursor )
void SwDoc::DelTable(SwTableNode *const pTableNd)
{
+ {
+ // tdf#156267 remove DdeBookmarks before deleting nodes
+ SwDataChanged aTmp(SwPaM(*pTableNd, *pTableNd->EndOfSectionNode()));
+ }
+
bool bNewTextNd = false;
// Is it alone in a FlyFrame?
SwNodeIndex aIdx( *pTableNd, -1 );