TechDraw: remove double type checking

Fixes #20131
This commit is contained in:
jonzirk76
2025-03-20 06:03:03 -04:00
committed by Chris Hennes
parent bdf04aafbd
commit 9ac7e6d17c
6 changed files with 21 additions and 31 deletions

View File

@@ -442,7 +442,7 @@ DrawViewClip* DrawView::getClipGroup()
{
for (auto* obj : getInList()) {
if (obj->isDerivedFrom<DrawViewClip>()) {
return dynamic_cast<DrawViewClip*>(obj);
return static_cast<DrawViewClip*>(obj);
}
}
return nullptr;
@@ -452,7 +452,7 @@ DrawViewCollection *DrawView::getCollection() const
{
for (auto* obj : getInList()) {
if (obj->isDerivedFrom<DrawViewCollection>()) {
return dynamic_cast<DrawViewCollection*>(obj);
return static_cast<DrawViewCollection*>(obj);
}
}
return nullptr;
@@ -551,7 +551,7 @@ std::vector<TechDraw::DrawLeaderLine*> DrawView::getLeaders() const
std::vector<App::DocumentObject*> children = getInList();
for (std::vector<App::DocumentObject*>::iterator it = children.begin(); it != children.end(); ++it) {
if ((*it)->isDerivedFrom<DrawLeaderLine>()) {
TechDraw::DrawLeaderLine* lead = dynamic_cast<TechDraw::DrawLeaderLine*>(*it);
TechDraw::DrawLeaderLine* lead = static_cast<TechDraw::DrawLeaderLine*>(*it);
result.push_back(lead);
}
}