Drawing: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:39:01 +02:00
parent 41080dec5b
commit 96f8c2a5c3
8 changed files with 16 additions and 20 deletions

View File

@@ -69,7 +69,7 @@ void ViewProviderDrawingView::show(void)
if (!obj || obj->isRestoring()) {
return;
}
if (obj->getTypeId().isDerivedFrom(Drawing::FeatureView::getClassTypeId())) {
if (obj->isDerivedFrom<Drawing::FeatureView>()) {
// The 'Visible' property is marked as 'Output'. To update the drawing on recompute
// the parent page object is touched.
static_cast<Drawing::FeatureView*>(obj)->Visible.setValue(true);
@@ -88,7 +88,7 @@ void ViewProviderDrawingView::hide(void)
if (!obj || obj->isRestoring()) {
return;
}
if (obj->getTypeId().isDerivedFrom(Drawing::FeatureView::getClassTypeId())) {
if (obj->isDerivedFrom<Drawing::FeatureView>()) {
// The 'Visible' property is marked as 'Output'. To update the drawing on recompute
// the parent page object is touched.
static_cast<Drawing::FeatureView*>(obj)->Visible.setValue(false);
@@ -172,7 +172,7 @@ void ViewProviderDrawingClip::show(void)
if (!obj || obj->isRestoring()) {
return;
}
if (obj->getTypeId().isDerivedFrom(Drawing::FeatureClip::getClassTypeId())) {
if (obj->isDerivedFrom<Drawing::FeatureClip>()) {
// The 'Visible' property is marked as 'Output'. To update the drawing on recompute
// the parent page object is touched.
static_cast<Drawing::FeatureClip*>(obj)->Visible.setValue(true);
@@ -191,7 +191,7 @@ void ViewProviderDrawingClip::hide(void)
if (!obj || obj->isRestoring()) {
return;
}
if (obj->getTypeId().isDerivedFrom(Drawing::FeatureClip::getClassTypeId())) {
if (obj->isDerivedFrom<Drawing::FeatureClip>()) {
// The 'Visible' property is marked as 'Output'. To update the drawing on recompute
// the parent page object is touched.
static_cast<Drawing::FeatureClip*>(obj)->Visible.setValue(false);