TechDraw: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:39:03 +02:00
parent 464ffa7e73
commit 1d8a51b47b
22 changed files with 56 additions and 58 deletions

View File

@@ -877,8 +877,7 @@ gp_Ax2 DrawComplexSection::getCSFromBase(const std::string sectionName) const
// Base::Console().Message("DCS::getCSFromBase()\n");
App::DocumentObject* base = BaseView.getValue();
if (!base
|| !base->getTypeId().isDerivedFrom(
TechDraw::DrawViewPart::getClassTypeId())) {//is second clause necessary?
|| !base->isDerivedFrom<TechDraw::DrawViewPart>()) {//is second clause necessary?
//if this DCS does not have a baseView, we must use the existing SectionCS
return getSectionCS();
}
@@ -966,7 +965,7 @@ bool DrawComplexSection::isBaseValid() const
//complex section is not based on an existing DVP
return true;
}
if (!base->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) {
if (!base->isDerivedFrom<TechDraw::DrawViewPart>()) {
//this is probably an error somewhere. the valid options are base = a DVP,
//or no base
return false;