more bug fixes

This commit is contained in:
John Wiegley 2004-08-09 17:49:06 -04:00
parent 6e6246c927
commit 799e97e420
2 changed files with 17 additions and 8 deletions

View file

@ -191,12 +191,16 @@ void format_t::format_elements(std::ostream& out,
out << ""; out << "";
break; break;
case element_t::CODE: case element_t::CODE: {
if (details.entry && ! details.entry->code.empty()) std::string temp;
out << "(" << details.entry->code << ") "; if (details.entry && ! details.entry->code.empty()) {
else temp += "(";
out << ""; temp += details.entry->code;
temp += ") ";
}
out << temp;
break; break;
}
case element_t::PAYEE: case element_t::PAYEE:
if (details.entry) if (details.entry)
@ -211,15 +215,19 @@ void format_t::format_elements(std::ostream& out,
std::string name = (elem->type == element_t::ACCOUNT_FULLNAME ? std::string name = (elem->type == element_t::ACCOUNT_FULLNAME ?
details.account->fullname() : details.account->fullname() :
partial_account_name(details.account)); partial_account_name(details.account));
if (elem->max_width > 0)
name = truncated(name, elem->max_width);
if (details.xact && details.xact->flags & TRANSACTION_VIRTUAL) { if (details.xact && details.xact->flags & TRANSACTION_VIRTUAL) {
if (elem->max_width > 2)
name = truncated(name, elem->max_width - 2);
if (details.xact->flags & TRANSACTION_BALANCE) if (details.xact->flags & TRANSACTION_BALANCE)
name = "[" + name + "]"; name = "[" + name + "]";
else else
name = "(" + name + ")"; name = "(" + name + ")";
} }
else if (elem->max_width > 0)
name = truncated(name, elem->max_width);
out << name; out << name;
} else { } else {
out << " "; out << " ";

3
walk.h
View file

@ -69,7 +69,8 @@ void handle_transaction(transaction_t * xact,
for (transactions_list::iterator i = xact->entry->transactions.begin(); for (transactions_list::iterator i = xact->entry->transactions.begin();
i != xact->entry->transactions.end(); i != xact->entry->transactions.end();
i++) i++)
if (! ((*i)->flags & TRANSACTION_AUTO) && if ((! (flags & OTHER_TRANSACTIONS) ||
! ((*i)->flags & TRANSACTION_AUTO)) &&
! ((*i)->dflags & TRANSACTION_HANDLED) && ! ((*i)->dflags & TRANSACTION_HANDLED) &&
(*i == xact ? (*i == xact ?
(flags & MATCHING_TRANSACTIONS) : (flags & OTHER_TRANSACTIONS))) { (flags & MATCHING_TRANSACTIONS) : (flags & OTHER_TRANSACTIONS))) {