Revert "[Gui] Fix "Select dependent objects" with cycles"

This reverts commit 01effaaab0.
This commit is contained in:
Ladislav Michl
2025-05-31 19:39:11 +02:00
parent 1cd7008641
commit 487542185d

View File

@@ -1303,11 +1303,11 @@ void TreeWidget::addDependentToSelection(App::Document* doc, App::DocumentObject
{
// add the docObject to the selection
Selection().addSelection(doc->getName(), docObject->getNameInDocument());
// get the dependent objects recursively
auto subObjectList = docObject->getOutListRecursive();
for (auto itDepend = subObjectList.begin(); itDepend != subObjectList.end(); ++itDepend) {
Selection().addSelection(doc->getName(), (*itDepend)->getNameInDocument());
}
// get the dependent
auto subObjectList = docObject->getOutList();
// the dependent can in turn have dependents, thus add them recursively
for (auto itDepend = subObjectList.begin(); itDepend != subObjectList.end(); ++itDepend)
addDependentToSelection(doc, (*itDepend));
}
// add dependents of the selected tree object to selection