MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / CopyOnImportExternal

Method CopyOnImportExternal

src/App/PropertyExpressionEngine.cpp:1030–1060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1028}
1029
1030Property* 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
1062Property* PropertyExpressionEngine::CopyOnLabelChange(App::DocumentObject* obj,
1063 const std::string& ref,

Callers

nothing calls this directly

Calls 6

ExpressionInfoClass · 0.85
beginMethod · 0.45
endMethod · 0.45
releaseMethod · 0.45
importSubNamesMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected