Allow interchangable use of link properties and their derivatives

This commit is contained in:
Stefan Tröger
2017-07-20 20:20:15 +02:00
committed by wmayer
parent 987a5b36b9
commit d0954e6e42
8 changed files with 15 additions and 15 deletions

View File

@@ -2801,7 +2801,7 @@ DocumentObject* Document::moveObject(DocumentObject* obj, bool recursive)
std::map<std::string,App::Property*> props;
obj->getPropertyMap(props);
for (std::map<std::string,App::Property*>::iterator it = props.begin(); it != props.end(); ++it) {
if (it->second->getTypeId() == PropertyLink::getClassTypeId()) {
if (it->second->getTypeId().isDerivedFrom(PropertyLink::getClassTypeId())) {
DocumentObject* link = static_cast<PropertyLink*>(it->second)->getValue();
if (recursive) {
moveObject(link, recursive);
@@ -2811,7 +2811,7 @@ DocumentObject* Document::moveObject(DocumentObject* obj, bool recursive)
static_cast<PropertyLink*>(it->second)->setValue(0);
}
}
else if (it->second->getTypeId() == PropertyLinkList::getClassTypeId()) {
else if (it->second->getTypeId().isDerivedFrom(PropertyLinkList::getClassTypeId())) {
std::vector<DocumentObject*> links = static_cast<PropertyLinkList*>(it->second)->getValues();
if (recursive) {
for (std::vector<DocumentObject*>::iterator jt = links.begin(); jt != links.end(); ++jt)