From 1299b3eb9fc6d03931a9d73fbc588c55f8ccb968 Mon Sep 17 00:00:00 2001 From: theo-vt Date: Sun, 3 Aug 2025 09:45:04 -0400 Subject: [PATCH] Core: Set ::Remove flag before calling breakLinks (#22759) * Ensure the ::Remove flag of DocumentObject is set to true before calls to breakLinks * TechDraw: remove then add balloon annotation when changing the SourceView * Revert "TechDraw: remove then add balloon annotation when changing the SourceView" This reverts commit 483b4fe4a0715ff63c2669af33fc3beb60a93f54. --- src/App/Document.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 28976853d0..5c01df8069 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -3282,6 +3282,8 @@ void Document::_removeObject(DocumentObject* pcObject, RemoveObjectOptions optio pcObject->unsetupObject(); } signalDeletedObject(*pcObject); + signalTransactionRemove(*pcObject, d->rollback ? nullptr : d->activeUndoTransaction); + breakDependency(pcObject, true); // TODO Check me if it's needed (2015-09-01, Fat-Zer) // remove the tip if needed @@ -3298,16 +3300,8 @@ void Document::_removeObject(DocumentObject* pcObject, RemoveObjectOptions optio // do no transactions if we do a rollback! if (!d->rollback && d->activeUndoTransaction) { - // Undo stuff - signalTransactionRemove(*pcObject, d->activeUndoTransaction); - breakDependency(pcObject, true); d->activeUndoTransaction->addObjectNew(pcObject); } - else { - // for a rollback delete the object - signalTransactionRemove(*pcObject, 0); - breakDependency(pcObject, true); - } std::unique_ptr tobedestroyed; if ((options.testFlag(RemoveObjectOption::MayDestroyOutOfTransaction) && !d->rollback && !d->activeUndoTransaction)