diff --git a/src/Mod/PartDesign/Gui/ViewProvider.cpp b/src/Mod/PartDesign/Gui/ViewProvider.cpp index 6249768fb..2b4858b87 100644 --- a/src/Mod/PartDesign/Gui/ViewProvider.cpp +++ b/src/Mod/PartDesign/Gui/ViewProvider.cpp @@ -108,3 +108,22 @@ void ViewProvider::updateData(const App::Property* prop) } inherited::updateData(prop); } + +bool ViewProvider::onDelete(const std::vector &) +{ + // Body feature housekeeping + Part::BodyBase* body = Part::BodyBase::findBodyOf(getObject()); + if (body != NULL) { + body->removeFeature(getObject()); + // Make the new Tip and the previous solid feature visible again + App::DocumentObject* tip = body->Tip.getValue(); + App::DocumentObject* prev = body->getPrevSolidFeature(); + if (tip != NULL) { + Gui::Application::Instance->getViewProvider(tip)->show(); + if ((tip != prev) && (prev != NULL)) + Gui::Application::Instance->getViewProvider(prev)->show(); + } + } + + return true; +} diff --git a/src/Mod/PartDesign/Gui/ViewProvider.h b/src/Mod/PartDesign/Gui/ViewProvider.h index 32926f154..6e859a22e 100644 --- a/src/Mod/PartDesign/Gui/ViewProvider.h +++ b/src/Mod/PartDesign/Gui/ViewProvider.h @@ -45,6 +45,8 @@ public: protected: virtual void unsetEdit(int ModNum); + virtual bool onDelete(const std::vector &); + std::string oldWb; App::DocumentObject* oldTip; };