Spreadsheet: AggregateFunctionExpression missed its own implementation of copy().
This causes a crash during undo if this class is used.
This commit is contained in:
parent
4d0af95caf
commit
aef7bbdf62
|
@ -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.
|
||||
|
|
|
@ -90,6 +90,8 @@ public:
|
|||
|
||||
virtual ~AggregateFunctionExpression();
|
||||
|
||||
virtual Expression * copy() const;
|
||||
|
||||
virtual App::Expression * eval() const;
|
||||
|
||||
virtual std::string toString() const;
|
||||
|
|
Loading…
Reference in New Issue
Block a user