Spreadsheet: AggregateFunctionExpression missed its own implementation of copy().

This causes a crash during undo if this class is used.
This commit is contained in:
Eivind Kvedalen 2015-12-03 21:41:50 +01:00 committed by wmayer
parent 4d0af95caf
commit aef7bbdf62
2 changed files with 15 additions and 0 deletions

View File

@ -87,6 +87,19 @@ AggregateFunctionExpression::~AggregateFunctionExpression()
{
}
Expression *AggregateFunctionExpression::copy() const
{
std::vector<Expression*>::const_iterator i = args.begin();
std::vector<Expression*> a;
while (i != args.end()) {
a.push_back((*i)->copy());
++i;
}
return new AggregateFunctionExpression(owner, f, a);
}
/**
* Evaluate function. Returns a NumberExpression if evaluation is successfuly.
* Throws an exception if something fails.

View File

@ -90,6 +90,8 @@ public:
virtual ~AggregateFunctionExpression();
virtual Expression * copy() const;
virtual App::Expression * eval() const;
virtual std::string toString() const;