*** empty log message ***

This commit is contained in:
John Wiegley 2004-04-10 10:52:14 +00:00
parent 46a3f91c4e
commit b5097ced2b
2 changed files with 14 additions and 20 deletions

View file

@ -470,8 +470,8 @@ static void parse_number(mpz_t out, const std::string& number,
else {
static char buf[256];
// The number is specified as the user desires, with the
// commodity telling us how to parse it.
// The number is specified as the user desires, with the commodity
// telling us how to parse it.
std::memset(buf, '0', 255);
std::strncpy(buf, num, std::strlen(num));

View file

@ -44,12 +44,13 @@ void transaction::print(std::ostream& out, bool display_quantity,
if (cost && display_quantity) {
out << " ";
out.width(10);
out.width(12);
std::string value = cost->as_str(true);
if (! display_price) {
int index = value.find('@');
value = std::string(value, index - 1);
if (index != -1)
value = std::string(value, 0, index - 1);
}
out << std::right << value;
}
@ -71,29 +72,23 @@ void entry::print(std::ostream& out, bool shortcut) const
if (! code.empty())
out << '(' << code << ") ";
if (! desc.empty())
out << " " << desc;
out << desc;
out << std::endl;
// jww (2003-10-11): Unspecified virtual transactions should not
// factor into the size computation.
commodity * comm = NULL;
int size = 0;
commodity * comm = NULL;
int size = 0;
for (std::list<transaction *>::const_iterator x = xacts.begin();
x != xacts.end();
x++) {
if ((*x)->is_virtual && ! (*x)->specified)
if ((*x)->is_virtual && ! (*x)->must_balance)
continue;
if (! comm) {
if (! comm)
comm = (*x)->cost->commdty();
}
else if (comm != (*x)->cost->commdty()) {
else if (comm != (*x)->cost->commdty())
shortcut = false;
break;
}
size++;
}
@ -109,10 +104,9 @@ void entry::print(std::ostream& out, bool shortcut) const
out << " ";
// jww (2003-10-03): If we are shortcutting, don't print the
// "per-unit price" of a commodity, if it is not necessary.
(*x)->print(out, ! shortcut || x == xacts.begin());
(*x)->print(out, (! shortcut || x == xacts.begin() ||
((*x)->is_virtual && ! (*x)->must_balance)),
size != 2);
}
out << std::endl;