PropertyExpressionEngine: Fixed bug in Copy and Paste (make deep copies of the expressions).

This commit is contained in:
Eivind Kvedalen 2016-02-11 00:27:57 +01:00 committed by wmayer
parent 9606fb144a
commit 727a06689a

View File

@ -110,7 +110,7 @@ Property *PropertyExpressionEngine::Copy() const
PropertyExpressionEngine * engine = new PropertyExpressionEngine();
for (ExpressionMap::const_iterator it = expressions.begin(); it != expressions.end(); ++it)
engine->expressions[it->first] = ExpressionInfo(it->second);
engine->expressions[it->first] = ExpressionInfo(boost::shared_ptr<Expression>(it->second.expression->copy()), it->second.comment.c_str());
engine->validator = validator;
@ -125,7 +125,7 @@ void PropertyExpressionEngine::Paste(const Property &from)
expressions.clear();
for (ExpressionMap::const_iterator it = fromee->expressions.begin(); it != fromee->expressions.end(); ++it) {
expressions[it->first] = ExpressionInfo(it->second);
expressions[it->first] = ExpressionInfo(boost::shared_ptr<Expression>(it->second.expression->copy()), it->second.comment.c_str());
expressionChanged(it->first);
}