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

@@ -105,22 +105,22 @@ void ViewProviderDatum::attach(App::DocumentObject *obj)
// TODO remove this field (2015-09-08, Fat-Zer)
App::DocumentObject* o = getObject();
if (o->getTypeId() == PartDesign::Plane::getClassTypeId()) {
if (o->is<PartDesign::Plane>()) {
datumType = QString::fromLatin1("Plane");
datumText = QObject::tr("Plane");
datumMenuText = tr("Datum Plane parameters");
}
else if (o->getTypeId() == PartDesign::Line::getClassTypeId()) {
else if (o->is<PartDesign::Line>()) {
datumType = QString::fromLatin1("Line");
datumText = QObject::tr("Line");
datumMenuText = tr("Datum Line parameters");
}
else if (o->getTypeId() == PartDesign::Point::getClassTypeId()) {
else if (o->is<PartDesign::Point>()) {
datumType = QString::fromLatin1("Point");
datumText = QObject::tr("Point");
datumMenuText = tr("Datum Point parameters");
}
else if (o->getTypeId() == PartDesign::CoordinateSystem::getClassTypeId()) {
else if (o->is<PartDesign::CoordinateSystem>()) {
datumType = QString::fromLatin1("CoordinateSystem");
datumText = QObject::tr("Coordinate System");
datumMenuText = tr("Local Coordinate System parameters");