Coverity: Unchecked dynamic_cast

This commit is contained in:
wmayer
2020-07-20 12:37:08 +02:00
parent 1a16cde1f5
commit 45b755a596
6 changed files with 14 additions and 5 deletions

View File

@@ -235,11 +235,11 @@ DrawPage* DrawView::findParentPage() const
std::vector<App::DocumentObject*> parent = getInList();
for (std::vector<App::DocumentObject*>::iterator it = parent.begin(); it != parent.end(); ++it) {
if ((*it)->getTypeId().isDerivedFrom(DrawPage::getClassTypeId())) {
page = dynamic_cast<TechDraw::DrawPage *>(*it);
page = static_cast<TechDraw::DrawPage *>(*it);
}
if ((*it)->getTypeId().isDerivedFrom(DrawViewCollection::getClassTypeId())) {
collection = dynamic_cast<TechDraw::DrawViewCollection *>(*it);
collection = static_cast<TechDraw::DrawViewCollection *>(*it);
page = collection->findParentPage();
}