Skip to content

Commit

Permalink
App: fix linked copy on change group out of scope problem
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed Apr 20, 2024
1 parent eb59682 commit 78b492a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/App/Link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,13 @@ void LinkBaseExtension::setProperty(int idx, Property *prop) {
propEnum->setEnums(enums);
break;
}
case PropLinkCopyOnChangeTouched:
case PropLinkCopyOnChangeSource:
case PropLinkCopyOnChangeGroup:
if (auto linkProp = Base::freecad_dynamic_cast<PropertyLinkBase>(prop)) {
linkProp->setScope(LinkScope::Global);
}
// fall through
case PropLinkCopyOnChangeTouched:
prop->setStatus(Property::Hidden, true);
break;
case PropLinkTransform:
Expand All @@ -261,9 +265,13 @@ void LinkBaseExtension::setProperty(int idx, Property *prop) {
case PropLinkedObject:
// Make ElementList as read-only if we are not a group (i.e. having
// LinkedObject property), because it is for holding array elements.
if(getElementListProperty())
if(getElementListProperty()) {
getElementListProperty()->setStatus(
Property::Immutable, getLinkedObjectProperty() != nullptr);
}
if (auto linkProp = getLinkedObjectProperty()) {
linkProp->setScope(LinkScope::Global);
}
break;
case PropVisibilityList:
getVisibilityListProperty()->setStatus(Property::Immutable, true);
Expand Down

0 comments on commit 78b492a

Please sign in to comment.