TechDraw: Fix projection groups not recursively deleting
This commit is contained in:
committed by
Kacper Donat
parent
6bed5b4255
commit
5642620281
@@ -1211,3 +1211,25 @@ void DrawProjGroup::handleChangedPropertyType(Base::XMLReader& reader, const cha
|
||||
spacingY.setValue(spacingYProperty.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
void DrawProjGroup::unsetupObject()
|
||||
{
|
||||
if (getDocument() && !getDocument()->isAnyRestoring()) {
|
||||
|
||||
std::vector<std::string> childNamesToDelete;
|
||||
for (App::DocumentObject* child : Views.getValues()) {
|
||||
if (child) {
|
||||
const char* name = child->getNameInDocument();
|
||||
if (name) {
|
||||
childNamesToDelete.push_back(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const std::string& childName : childNamesToDelete) {
|
||||
getDocument()->removeObject(childName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
DrawViewCollection::unsetupObject();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user