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.
This commit is contained in:
theo-vt
2025-08-03 09:45:04 -04:00
committed by GitHub
parent afa61ab0d1
commit 1299b3eb9f

View File

@@ -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<DocumentObject> tobedestroyed;
if ((options.testFlag(RemoveObjectOption::MayDestroyOutOfTransaction) && !d->rollback && !d->activeUndoTransaction)