PartDesign: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:39:11 +02:00
parent 2e16f5aa36
commit 6adc675a12
26 changed files with 114 additions and 114 deletions

View File

@@ -231,7 +231,7 @@ void CmdPartDesignBody::activated(int iMsg)
if (body) {
std::vector<App::DocumentObject*> links = body->Group.getValues();
for (auto it : links) {
if (it->getTypeId().isDerivedFrom(PartDesign::FeatureBase::getClassTypeId())) {
if (it->isDerivedFrom<PartDesign::FeatureBase>()) {
PartDesign::FeatureBase* base = static_cast<PartDesign::FeatureBase*>(it);
if (base && base->BaseFeature.getValue() == baseFeature) {
Gui::Application::Instance->hideViewProvider(baseFeature);
@@ -797,7 +797,7 @@ void CmdPartDesignMoveFeature::activated(int iMsg)
}
// Fix sketch support
if (feat->getTypeId().isDerivedFrom(Sketcher::SketchObject::getClassTypeId())) {
if (feat->isDerivedFrom<Sketcher::SketchObject>()) {
Sketcher::SketchObject *sketch = static_cast<Sketcher::SketchObject*>(feat);
try {
PartDesignGui::fixSketchSupport(sketch);