TechDraw: Fix projection groups not recursively deleting

This commit is contained in:
Ryan Kembrey
2025-09-14 16:38:53 +10:00
committed by Kacper Donat
parent 6bed5b4255
commit 5642620281
2 changed files with 23 additions and 0 deletions

View File

@@ -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();
}