PD: do not use active document in task dialogs because this is error-prone
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/CommandT.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Mod/PartDesign/App/Feature.h>
|
||||
@@ -110,7 +110,7 @@ bool TaskDlgFeatureParameters::accept() {
|
||||
|
||||
FCMD_OBJ_HIDE(previous);
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
|
||||
Gui::cmdAppDocument(feature, "recompute()");
|
||||
|
||||
if (!feature->isValid()) {
|
||||
throw Base::RuntimeError(vp->getObject()->getStatusString());
|
||||
@@ -125,7 +125,7 @@ bool TaskDlgFeatureParameters::accept() {
|
||||
param->detachSelection();
|
||||
}
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
||||
Gui::cmdGuiDocument(feature, "resetEdit()");
|
||||
Gui::Command::commitCommand();
|
||||
} catch (const Base::Exception& e) {
|
||||
// Generally the only thing that should fail is feature->isValid() others should be fine
|
||||
|
||||
Reference in New Issue
Block a user