| 622 | } |
| 623 | |
| 624 | void DlgExpressionInput::createBindingVarSet(App::Property* propVarSet, App::DocumentObject* varSet) |
| 625 | { |
| 626 | ObjectIdentifier varSetId(*propVarSet); |
| 627 | |
| 628 | // rewrite the identifiers of the expression to be relative to the VarSet |
| 629 | std::map<App::ObjectIdentifier, bool> identifiers = expression->getIdentifiers(); |
| 630 | |
| 631 | std::map<ObjectIdentifier, ObjectIdentifier> idsFromObjToVarSet; |
| 632 | for (const auto& idPair : identifiers) { |
| 633 | ObjectIdentifier exprId = idPair.first; |
| 634 | ObjectIdentifier relativeId = exprId.relativeTo(varSetId); |
| 635 | idsFromObjToVarSet[exprId] = relativeId; |
| 636 | } |
| 637 | |
| 638 | Binding binding; |
| 639 | binding.bind(*propVarSet); |
| 640 | binding.setExpression(expression); |
| 641 | binding.apply(); |
| 642 | |
| 643 | varSet->renameObjectIdentifiers(idsFromObjToVarSet); |
| 644 | } |
| 645 | |
| 646 | void DlgExpressionInput::acceptWithVarSet() |
| 647 | { |
nothing calls this directly
no test coverage detected