Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's

Regex based changes, manually verified
This commit is contained in:
Benjamin Nauck
2025-01-16 21:27:50 +01:00
parent 6a3eb2ab49
commit 6f535f19fb
166 changed files with 484 additions and 497 deletions

View File

@@ -1167,7 +1167,7 @@ int LinkBaseExtension::extensionIsElementVisible(const char* element)
const DocumentObject* LinkBaseExtension::getContainer() const
{
auto ext = getExtendedContainer();
if (!ext || !ext->isDerivedFrom(DocumentObject::getClassTypeId())) {
if (!ext || !ext->isDerivedFrom<DocumentObject>()) {
LINK_THROW(Base::RuntimeError, "Link: container not derived from document object");
}
return static_cast<const DocumentObject*>(ext);
@@ -1176,7 +1176,7 @@ const DocumentObject* LinkBaseExtension::getContainer() const
DocumentObject* LinkBaseExtension::getContainer()
{
auto ext = getExtendedContainer();
if (!ext || !ext->isDerivedFrom(DocumentObject::getClassTypeId())) {
if (!ext || !ext->isDerivedFrom<DocumentObject>()) {
LINK_THROW(Base::RuntimeError, "Link: container not derived from document object");
}
return static_cast<DocumentObject*>(ext);