diff --git a/src/Mod/Part/Gui/TaskAttacher.cpp b/src/Mod/Part/Gui/TaskAttacher.cpp index 133e9cefea..23510f7721 100644 --- a/src/Mod/Part/Gui/TaskAttacher.cpp +++ b/src/Mod/Part/Gui/TaskAttacher.cpp @@ -1073,9 +1073,7 @@ TaskDlgAttacher::~TaskDlgAttacher() = default; void TaskDlgAttacher::open() { - Gui::Document* document = Gui::Application::Instance->getDocument(ViewProvider->getObject()->getDocument()); - if (!document->hasPendingCommand()) - document->openCommand(QT_TRANSLATE_NOOP("Command", "Edit attachment")); + Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Edit attachment")); } void TaskDlgAttacher::clicked(int) @@ -1113,7 +1111,7 @@ bool TaskDlgAttacher::accept() Gui::cmdAppObject(obj, "recompute()"); Gui::cmdGuiDocument(obj, "resetEdit()"); - document->commitCommand(); + Gui::Command::commitCommand(); } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Datum dialog: Input error"), QCoreApplication::translate("Exception", e.what())); @@ -1129,7 +1127,7 @@ bool TaskDlgAttacher::reject() Gui::Document* document = doc.getDocument(); if (document) { // roll back the done things - document->abortCommand(); + Gui::Command::abortCommand(); Gui::Command::doCommand(Gui::Command::Gui,"%s.resetEdit()", doc.getGuiDocumentPython().c_str()); Gui::Command::doCommand(Gui::Command::Doc,"%s.recompute()", doc.getAppDocumentPython().c_str()); }