TechDraw: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:39:03 +02:00
parent 0193e20b26
commit 24352a7f4c
22 changed files with 56 additions and 58 deletions

View File

@@ -67,7 +67,7 @@ App::DocumentObjectExecReturn *FeatureProjection::execute()
App::DocumentObject* link = Source.getValue();
if (!link)
return new App::DocumentObjectExecReturn("No object linked");
if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))
if (!link->isDerivedFrom<Part::Feature>())
return new App::DocumentObjectExecReturn("Linked object is not a Part object");
const TopoDS_Shape& shape = static_cast<Part::Feature*>(link)->Shape.getShape().getShape();
if (shape.IsNull())