Part: modernize type checking
This commit is contained in:
@@ -210,7 +210,7 @@ void ViewProvider2DObjectGrid::updateData(const App::Property* prop)
|
||||
{
|
||||
ViewProvider2DObject::updateData(prop);
|
||||
|
||||
if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId()) {
|
||||
if (prop->is<Part::PropertyPartShape>()) {
|
||||
if (GridAutoSize.getValue()) {
|
||||
Base::BoundBox3d bbox = static_cast<const Part::PropertyPartShape*>(prop)->getBoundingBox();
|
||||
if (!bbox.IsValid())
|
||||
@@ -263,7 +263,7 @@ void ViewProvider2DObjectGrid::handleChangedPropertyType(Base::XMLReader &reader
|
||||
App::Property * prop)
|
||||
{
|
||||
Base::Type inputType = Base::Type::fromName(TypeName);
|
||||
if (prop->getTypeId().isDerivedFrom(App::PropertyFloat::getClassTypeId()) &&
|
||||
if (prop->isDerivedFrom<App::PropertyFloat>() &&
|
||||
inputType.isDerivedFrom(App::PropertyFloat::getClassTypeId())) {
|
||||
// Do not directly call the property's Restore method in case the implementation
|
||||
// has changed. So, create a temporary PropertyFloat object and assign the value.
|
||||
|
||||
Reference in New Issue
Block a user