Assembly: Use freecad_cast whenever possible

This commit is contained in:
Kacper Donat
2025-04-25 00:05:43 +02:00
committed by Benjamin Nauck
parent 0e2fd36551
commit ff99df4c4d
5 changed files with 14 additions and 14 deletions

View File

@@ -600,7 +600,7 @@ T* AssemblyObject::getGroup()
}
for (auto group : groups) {
if (hasObject(group)) {
return dynamic_cast<T*>(group);
return freecad_cast<T*>(group);
}
}
return nullptr;
@@ -621,7 +621,7 @@ ViewGroup* AssemblyObject::getExplodedViewGroup() const
}
for (auto viewGroup : viewGroups) {
if (hasObject(viewGroup)) {
return dynamic_cast<ViewGroup*>(viewGroup);
return freecad_cast<ViewGroup*>(viewGroup);
}
}
return nullptr;
@@ -1935,7 +1935,7 @@ std::vector<AssemblyLink*> AssemblyObject::getSubAssemblies()
doc->getObjectsOfType(Assembly::AssemblyLink::getClassTypeId());
for (auto assembly : assemblies) {
if (hasObject(assembly)) {
subAssemblies.push_back(dynamic_cast<AssemblyLink*>(assembly));
subAssemblies.push_back(freecad_cast<AssemblyLink*>(assembly));
}
}