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 4a861c75d5
commit 13068d2bab
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.