Cleanup orphan features on DVP delete

This commit is contained in:
WandererFan
2017-02-09 13:18:22 -05:00
parent 63d5749b67
commit 513decf8c8
5 changed files with 55 additions and 13 deletions

View File

@@ -325,14 +325,14 @@ void DrawPage::unsetupObject()
App::Document* doc = getDocument();
std::string docName = doc->getName();
const std::vector<App::DocumentObject*> currViews = Views.getValues();
std::vector<App::DocumentObject*> emptyViews;
std::vector<App::DocumentObject*>::const_iterator it = currViews.begin();
for (; it != currViews.end(); it++) {
std::string viewName = (*it)->getNameInDocument();
while (Views.getValues().size() > 0 ) {
const std::vector<App::DocumentObject*> currViews = Views.getValues();
App::DocumentObject* child = currViews.front();
std::string viewName = child->getNameInDocument();
Base::Interpreter().runStringArg("App.getDocument(\"%s\").removeObject(\"%s\")",
docName.c_str(), viewName.c_str());
}
std::vector<App::DocumentObject*> emptyViews; //probably superfluous
Views.setValues(emptyViews);
App::DocumentObject* tmp = Template.getValue();