| 1028 | } |
| 1029 | |
| 1030 | Property* PropertyExpressionEngine::CopyOnImportExternal( |
| 1031 | const std::map<std::string, std::string>& nameMap) const |
| 1032 | { |
| 1033 | std::unique_ptr<PropertyExpressionEngine> engine; |
| 1034 | for (auto it = expressions.begin(); it != expressions.end(); ++it) { |
| 1035 | #ifdef BOOST_NO_CXX11_SMART_PTR |
| 1036 | std::shared_ptr<Expression> expr(it->second.expression->importSubNames(nameMap).release()); |
| 1037 | #else |
| 1038 | std::shared_ptr<Expression> expr(it->second.expression->importSubNames(nameMap)); |
| 1039 | #endif |
| 1040 | if (!expr && !engine) { |
| 1041 | continue; |
| 1042 | } |
| 1043 | if (!engine) { |
| 1044 | engine = std::make_unique<PropertyExpressionEngine>(); |
| 1045 | for (auto it2 = expressions.begin(); it2 != it; ++it2) { |
| 1046 | engine->expressions[it2->first] = |
| 1047 | ExpressionInfo(std::shared_ptr<Expression>(it2->second.expression->copy())); |
| 1048 | } |
| 1049 | } |
| 1050 | else if (!expr) { |
| 1051 | expr = it->second.expression; |
| 1052 | } |
| 1053 | engine->expressions[it->first] = ExpressionInfo(expr); |
| 1054 | } |
| 1055 | if (!engine) { |
| 1056 | return nullptr; |
| 1057 | } |
| 1058 | engine->validator = validator; |
| 1059 | return engine.release(); |
| 1060 | } |
| 1061 | |
| 1062 | Property* PropertyExpressionEngine::CopyOnLabelChange(App::DocumentObject* obj, |
| 1063 | const std::string& ref, |
nothing calls this directly
no test coverage detected