summaryrefslogtreecommitdiffstats
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:31:21 +0200
commit20c272631877d2c77bd0b14fee41acfb056aade7 (patch)
treedf24af54f7dc3ab881be15dc9f5585e8d43508ae
parentxmloff: ODF import: adapt generator parsing to 2-digit major versions (diff)
downloadcore-20c272631877d2c77bd0b14fee41acfb056aade7.tar.gz
core-20c272631877d2c77bd0b14fee41acfb056aade7.zip
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> (cherry picked from commit 4270552395600487f9d680cfdc9cd0ad6f457497)
-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 b21acc7020c1..379c0a7666be 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1935,6 +1935,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 );