Toponaming: Cleanup

This commit is contained in:
bgbsww
2024-07-18 10:23:29 -04:00
parent c9232b141a
commit 5afdc19874
11 changed files with 361 additions and 69 deletions

View File

@@ -2278,32 +2278,34 @@ void PropertySheet::getLinksTo(std::vector<App::ObjectIdentifier>& identifiers,
all ? Expression::DepOption::DepAll : Expression::DepOption::DepNormal;
App::SubObjectT objT(obj, subname);
auto sobj = objT.getSubObject();
auto subObject = objT.getSubObject();
auto subElement = objT.getOldElementName();
auto owner = Base::freecad_dynamic_cast<App::DocumentObject>(getContainer());
for (const auto& v : data) {
if (auto expr = v.second->getExpression()) {
for (const auto& [cellName, cellExpression] : data) {
if (auto expr = cellExpression->getExpression()) {
const auto& deps = expr->getDeps(option);
auto it = deps.find(obj);
if (it == deps.end()) {
continue;
}
for (auto& dep : it->second) {
const auto [docObj, depsList] = *it;
for (auto& [depName, paths] : depsList) {
if (!subname) {
identifiers.emplace_back(owner, v.first.toString().c_str());
identifiers.emplace_back(owner, cellName.toString().c_str());
break;
}
bool found = false;
for (const auto& path : dep.second) {
for (const auto& path : paths) {
if (path.getSubObjectName() == subname) {
identifiers.emplace_back(owner, v.first.toString().c_str());
identifiers.emplace_back(owner, cellName.toString().c_str());
found = true;
break;
}
App::SubObjectT sobjT(obj, path.getSubObjectName().c_str());
if (sobjT.getSubObject() == sobj && sobjT.getOldElementName() == subElement) {
identifiers.emplace_back(owner, v.first.toString().c_str());
if (sobjT.getSubObject() == subObject
&& sobjT.getOldElementName() == subElement) {
identifiers.emplace_back(owner, cellName.toString().c_str());
found = true;
break;
}