diff --git a/src/Mod/PartDesign/Gui/TaskFeatureParameters.cpp b/src/Mod/PartDesign/Gui/TaskFeatureParameters.cpp index fba7bc0835..7a0861863e 100644 --- a/src/Mod/PartDesign/Gui/TaskFeatureParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskFeatureParameters.cpp @@ -90,7 +90,7 @@ TaskDlgFeatureParameters::~TaskDlgFeatureParameters() = default; bool TaskDlgFeatureParameters::accept() { App::DocumentObject* feature = getObject(); - + bool isUpdateBlocked = false; try { // Iterate over parameter dialogs and apply all parameters from them for ( QWidget *wgt : Content ) { @@ -100,6 +100,7 @@ bool TaskDlgFeatureParameters::accept() param->saveHistory (); param->apply (); + isUpdateBlocked |= param->isUpdateBlocked(); } // Make sure the feature is what we are expecting // Should be fine but you never know... @@ -107,7 +108,12 @@ bool TaskDlgFeatureParameters::accept() throw Base::TypeError("Bad object processed in the feature dialog."); } - Gui::cmdAppDocument(feature, "recompute()"); + if(isUpdateBlocked){ + Gui::cmdAppDocument(feature, "recompute()"); + } else { + // object was already computed + Gui::cmdAppDocument(feature, "purgeTouched()"); + } if (!feature->isValid()) { throw Base::RuntimeError(getObject()->getStatusString()); diff --git a/src/Mod/PartDesign/Gui/TaskFeatureParameters.h b/src/Mod/PartDesign/Gui/TaskFeatureParameters.h index fe284ae740..29fe6b2393 100644 --- a/src/Mod/PartDesign/Gui/TaskFeatureParameters.h +++ b/src/Mod/PartDesign/Gui/TaskFeatureParameters.h @@ -51,6 +51,11 @@ public: void recomputeFeature(); + bool isUpdateBlocked() const + { + return blockUpdate; + } + protected Q_SLOTS: // TODO Add update view to all dialogs (2015-12-05, Fat-Zer) void onUpdateView(bool on); @@ -88,11 +93,6 @@ protected: return obj ? obj->getDocument() : nullptr; } - bool isUpdateBlocked() const - { - return blockUpdate; - } - bool& getUpdateBlockRef() { return blockUpdate;