App: Use freecad_cast whenever possible

This commit is contained in:
Kacper Donat
2025-04-25 00:05:39 +02:00
committed by Benjamin Nauck
parent 019a25ad75
commit 7accf81bbe
6 changed files with 21 additions and 21 deletions

View File

@@ -428,7 +428,7 @@ void DocumentObject::getOutList(int options, std::vector<DocumentObject*>& res)
bool noHidden = !!(options & OutListNoHidden);
std::size_t size = res.size();
for (auto prop : props) {
auto link = dynamic_cast<PropertyLinkBase*>(prop);
auto link = freecad_cast<PropertyLinkBase*>(prop);
if (link) {
link->getLinks(res, noHidden);
}
@@ -457,7 +457,7 @@ std::vector<App::DocumentObject*> DocumentObject::getOutListOfProperty(App::Prop
return ret;
}
auto link = dynamic_cast<PropertyLinkBase*>(prop);
auto link = freecad_cast<PropertyLinkBase*>(prop);
if (link) {
link->getLinks(ret);
}
@@ -629,7 +629,7 @@ DocumentObject::getPathsByOutList(App::DocumentObject* to) const
DocumentObjectGroup* DocumentObject::getGroup() const
{
return dynamic_cast<DocumentObjectGroup*>(GroupExtension::getGroupOfObject(this));
return freecad_cast<DocumentObjectGroup*>(GroupExtension::getGroupOfObject(this));
}
bool DocumentObject::testIfLinkDAGCompatible(DocumentObject* linkTo) const
@@ -1130,7 +1130,7 @@ DocumentObject* DocumentObject::getLinkedObject(bool recursive,
}
}
if (transform && mat) {
auto pla = dynamic_cast<PropertyPlacement*>(getPropertyByName("Placement"));
auto pla = freecad_cast<PropertyPlacement*>(getPropertyByName("Placement"));
if (pla) {
*mat *= pla->getValue().toMatrix();
}