Points: Use freecad_cast whenever possible
This commit is contained in:
committed by
Benjamin Nauck
parent
7accf81bbe
commit
76013ab7e0
@@ -37,15 +37,15 @@ bool copyProperty(App::DocumentObject* target,
|
||||
{
|
||||
// check for properties
|
||||
if (std::all_of(std::begin(source), std::end(source), [=](auto obj) {
|
||||
return dynamic_cast<PropertyT*>(obj->getPropertyByName(propertyName)) != nullptr;
|
||||
return freecad_cast<PropertyT*>(obj->getPropertyByName(propertyName)) != nullptr;
|
||||
})) {
|
||||
|
||||
auto target_prop = dynamic_cast<PropertyT*>(
|
||||
auto target_prop = freecad_cast<PropertyT*>(
|
||||
target->addDynamicProperty(PropertyT::getClassTypeId().getName(), propertyName));
|
||||
if (target_prop) {
|
||||
auto values = target_prop->getValues();
|
||||
for (auto it : source) {
|
||||
auto source_prop = dynamic_cast<PropertyT*>(it->getPropertyByName(propertyName));
|
||||
auto source_prop = freecad_cast<PropertyT*>(it->getPropertyByName(propertyName));
|
||||
if (source_prop) {
|
||||
auto source_values = source_prop->getValues();
|
||||
values.insert(values.end(), source_values.begin(), source_values.end());
|
||||
|
||||
Reference in New Issue
Block a user