GUI: fix "select all instances" (#25503)

This commit is contained in:
Chris
2025-11-26 14:20:23 -06:00
committed by GitHub
parent 58d12221a5
commit e26ffd782a

View File

@@ -6539,20 +6539,37 @@ int DocumentObjectItem::getSubName(std::ostringstream& str, App::DocumentObject*
int group = parent->isGroup();
if (group == NotGroup) {
if (ret != PartGroup) {
// Handle this situation,
//
// LinkGroup
// |--PartExtrude
// |--Sketch
//
// This function traverse from top down, so, when seeing a
// non-group object 'PartExtrude', its following children should
// not be grouped, so must reset any previous parents here.
topParent = nullptr;
str.str(""); // reset the current subname
return NotGroup;
// check if the parent explicitly claims this child,
// if so, we should include the parent in the subname path
auto children = parent->object()->claimChildren();
bool parentClaimsThis = false;
for (auto child : children) {
if (child == object()->getObject()) {
parentClaimsThis = true;
break;
}
}
if (!parentClaimsThis) {
// Handle this situation,
//
// LinkGroup
// |--PartExtrude
// |--Sketch
//
// This function traverse from top down, so, when seeing a
// non-group object 'PartExtrude', its following children should
// not be grouped, so must reset any previous parents here.
topParent = nullptr;
str.str(""); // reset the current subname
return NotGroup;
}
// if parent claims this child, treat it like a PartGroup
group = PartGroup;
}
else {
group = PartGroup;
}
group = PartGroup;
}
ret = group;
}