Allow to delete sub-elements in either case

This commit is contained in:
wmayer 2013-05-21 13:42:08 +02:00
parent 6fd74b77b7
commit b45c1dbb84

View File

@ -1030,6 +1030,9 @@ void StdCmdDelete::activated(int iMsg)
// check if we can delete the object // check if we can delete the object
for (std::vector<Gui::SelectionObject>::iterator ft = sel.begin(); ft != sel.end(); ++ft) { for (std::vector<Gui::SelectionObject>::iterator ft = sel.begin(); ft != sel.end(); ++ft) {
App::DocumentObject* obj = ft->getObject(); App::DocumentObject* obj = ft->getObject();
Gui::ViewProvider* vp = pGuiDoc->getViewProvider(ft->getObject());
// if the object is in edit mode we allow to continue because only sub-elements will be removed
if (!vp || !vp->isEditing()) {
std::vector<App::DocumentObject*> links = obj->getInList(); std::vector<App::DocumentObject*> links = obj->getInList();
if (!links.empty()) { if (!links.empty()) {
// check if the referenced objects are groups or are selected too // check if the referenced objects are groups or are selected too
@ -1045,6 +1048,7 @@ void StdCmdDelete::activated(int iMsg)
} }
} }
} }
}
if (doDeletion) { if (doDeletion) {
(*it)->openTransaction("Delete"); (*it)->openTransaction("Delete");