Require read-only and output attributes on updated properties

Require the property to be both read-only and output for it to be
updated back from support to binder when calculated with expression in
support.
This commit is contained in:
Alexey Chernov
2024-07-30 23:16:10 +03:00
committed by Chris Hennes
parent 4db7cd52e6
commit 66e1c0154d

View File

@@ -606,18 +606,21 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
std::vector<App::Property*> props;
getPropertyList(props);
// lambda for copying values of copy-on-change properties
const auto copyPropertyValues = [this, &recomputeCopy, &props, copied](const bool to_parent) {
const auto copyPropertyValues = [this, &recomputeCopy, &props, copied](const bool to_support) {
for (auto prop : props) {
if (!App::LinkBaseExtension::isCopyOnChangeProperty(this, *prop))
continue;
// we only copy read-only and output properties from support to binder
if (!to_support && !(prop->testStatus(App::Property::Output) && prop->testStatus(App::Property::ReadOnly)))
continue;
auto p = copied->getPropertyByName(prop->getName());
if (p && p->getContainer() == copied
&& p->getTypeId() == prop->getTypeId()
&& !p->isSame(*prop))
{
recomputeCopy = true;
auto* const from = to_parent ? prop : p;
auto* const to = to_parent ? p : prop;
auto* const from = to_support ? prop : p;
auto* const to = to_support ? p : prop;
std::unique_ptr<App::Property> pcopy(from->Copy());
to->Paste(*pcopy);