issue #0002080: Attempt to remove FEM analysis result (displacement & stress) results in false warning

This commit is contained in:
wmayer
2017-10-18 19:46:20 +02:00
parent 9bb1454ef4
commit 48155db774
5 changed files with 36 additions and 14 deletions

View File

@@ -1110,19 +1110,14 @@ void StdCmdDelete::activated(int iMsg)
if (!links.empty()) {
// check if the referenced objects are groups or are selected too
for (std::vector<App::DocumentObject*>::iterator lt = links.begin(); lt != links.end(); ++lt) {
if (
(!(*lt)->hasExtension(App::GroupExtension::getExtensionClassTypeId())) &&
(!(*lt)->isDerivedFrom(App::Origin::getClassTypeId())) &&
(!rSel.isSelected(*lt))
){
autoDeletion = false;
affectedLabels.insert(QString::fromUtf8((*lt)->Label.getValue()));
if (!rSel.isSelected(*lt)) {
ViewProvider* vp = pGuiDoc->getViewProvider(*lt);
if (!vp->canDelete(obj)) {
autoDeletion = false;
affectedLabels.insert(QString::fromUtf8((*lt)->Label.getValue()));
}
}
}
if (!autoDeletion) {
break;
}
}
}
@@ -1148,12 +1143,14 @@ void StdCmdDelete::activated(int iMsg)
Gui::ViewProvider* vp = pGuiDoc->getViewProvider(ft->getObject());
if (vp) {
// ask the ViewProvider if it wants to do some clean up
if (vp->onDelete(ft->getSubNames()))
if (vp->onDelete(ft->getSubNames())) {
doCommand(Doc,"App.getDocument(\"%s\").removeObject(\"%s\")"
,(*it)->getName(), ft->getFeatName());
}
}
}
(*it)->commitTransaction();
Gui::getMainWindow()->setUpdatesEnabled(true);
Gui::getMainWindow()->update();
}