summaryrefslogtreecommitdiff
path: root/src/balance.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-07 08:16:02 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-07 08:32:13 -0400
commita4d4f9979486eb82c05bd032e1452c2fd400249f (patch)
tree7451a16c967f4dbe32122bd20f96dc5e6b4ad231 /src/balance.cc
parent8bd362b5d17782cf8fa5317017a1c5d73d76f1b7 (diff)
downloadfork-ledger-a4d4f9979486eb82c05bd032e1452c2fd400249f.tar.gz
fork-ledger-a4d4f9979486eb82c05bd032e1452c2fd400249f.tar.bz2
fork-ledger-a4d4f9979486eb82c05bd032e1452c2fd400249f.zip
amount_t::print and value_t::print now use flags
Diffstat (limited to 'src/balance.cc')
-rw-r--r--src/balance.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/balance.cc b/src/balance.cc
index 9b39a49a..bfcd4a35 100644
--- a/src/balance.cc
+++ b/src/balance.cc
@@ -252,11 +252,10 @@ balance_t::strip_annotations(const keep_details_t& what_to_keep) const
return temp;
}
-void balance_t::print(std::ostream& out,
- const int first_width,
- const int latter_width,
- const bool right_justify,
- const bool colorize) const
+void balance_t::print(std::ostream& out,
+ const int first_width,
+ const int latter_width,
+ const uint_least8_t flags) const
{
bool first = true;
int lwidth = latter_width;
@@ -285,14 +284,14 @@ void balance_t::print(std::ostream& out,
}
std::ostringstream buf;
- buf << *amount;
- justify(out, buf.str(), width, right_justify,
- colorize && amount->sign() < 0);
+ amount->print(buf, flags);
+ justify(out, buf.str(), width, flags & AMOUNT_PRINT_RIGHT_JUSTIFY,
+ flags & AMOUNT_PRINT_COLORIZE && amount->sign() < 0);
}
if (first) {
out.width(first_width);
- if (right_justify)
+ if (flags & AMOUNT_PRINT_RIGHT_JUSTIFY)
out << std::right;
else
out << std::left;