Extend commodity_t::compare_by_commodity::operator()
This commit is contained in:
parent
db1bca2ad8
commit
d6274fee19
1 changed files with 9 additions and 0 deletions
|
|
@ -481,6 +481,15 @@ bool commodity_t::compare_by_commodity::operator()(const amount_t * left,
|
|||
if (aleftcomm.details.tag && arightcomm.details.tag)
|
||||
return *aleftcomm.details.tag < *arightcomm.details.tag;
|
||||
|
||||
if (! aleftcomm.details.value_expr && arightcomm.details.value_expr)
|
||||
return true;
|
||||
if (aleftcomm.details.value_expr && ! arightcomm.details.value_expr)
|
||||
return false;
|
||||
|
||||
if (aleftcomm.details.value_expr && arightcomm.details.value_expr)
|
||||
return (aleftcomm.details.value_expr->text() <
|
||||
arightcomm.details.value_expr->text());
|
||||
|
||||
assert(false);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue