Base: Rename Base::freecad_dynamic_cast into freecad_cast

This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
This commit is contained in:
Kacper Donat
2025-03-28 23:15:04 +01:00
committed by Chris Hennes
parent 5fb6638b7f
commit 9d97d1c895
73 changed files with 302 additions and 315 deletions

View File

@@ -1630,9 +1630,9 @@ std::vector<App::DocumentObject*> Document::importObjects(Base::XMLReader& reade
o->setStatus(App::ObjImporting, true);
FC_LOG("importing " << o->getFullName());
if (auto propUUID =
Base::freecad_dynamic_cast<PropertyUUID>(o->getPropertyByName("_ObjectUUID"))) {
freecad_cast<PropertyUUID>(o->getPropertyByName("_ObjectUUID"))) {
auto propSource =
Base::freecad_dynamic_cast<PropertyUUID>(o->getPropertyByName("_SourceUUID"));
freecad_cast<PropertyUUID>(o->getPropertyByName("_SourceUUID"));
if (!propSource) {
propSource = static_cast<PropertyUUID*>(
o->addDynamicProperty("App::PropertyUUID",
@@ -2439,7 +2439,7 @@ bool Document::afterRestore(const std::vector<DocumentObject*>& objArray, bool c
// refresh properties in case the object changes its property list
obj->getPropertyList(props);
for (auto prop : props) {
auto link = Base::freecad_dynamic_cast<PropertyLinkBase>(prop);
auto link = freecad_cast<PropertyLinkBase>(prop);
int res;
std::string errMsg;
if (link && (res = link->checkRestore(&errMsg))) {
@@ -3987,7 +3987,7 @@ Document::importLinks(const std::vector<App::DocumentObject*>& objArray)
propList.clear();
obj->getPropertyList(propList);
for (auto prop : propList) {
auto linkProp = Base::freecad_dynamic_cast<PropertyLinkBase>(prop);
auto linkProp = freecad_cast<PropertyLinkBase>(prop);
if (linkProp && !prop->testStatus(Property::Immutable) && !obj->isReadOnly(prop)) {
auto copy = linkProp->CopyOnImportExternal(nameMap);
if (copy) {