summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-21 02:06:01 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-21 02:06:01 -0500
commit5d4a0a39bee1fd1abd1a04e0614c75755df4485d (patch)
tree305b6055ed31c109beb3f694ec45c1859b621011 /src
parenteab95ad55b601d44af25dd65384e7980cd54a487 (diff)
downloadfork-ledger-5d4a0a39bee1fd1abd1a04e0614c75755df4485d.tar.gz
fork-ledger-5d4a0a39bee1fd1abd1a04e0614c75755df4485d.tar.bz2
fork-ledger-5d4a0a39bee1fd1abd1a04e0614c75755df4485d.zip
The Python web server now uses jQuery Tablesorter
Diffstat (limited to 'src')
-rw-r--r--src/balance.h4
-rw-r--r--src/value.cc17
2 files changed, 14 insertions, 7 deletions
diff --git a/src/balance.h b/src/balance.h
index a8a46d53..826de134 100644
--- a/src/balance.h
+++ b/src/balance.h
@@ -541,8 +541,8 @@ public:
void print(std::ostream& out,
const int first_width = -1,
const int latter_width = -1,
- const bool right_justify = true,
- const bool colorize = true) const;
+ const bool right_justify = false,
+ const bool colorize = false) const;
/**
* Debugging methods. There are two methods defined to help with
diff --git a/src/value.cc b/src/value.cc
index e2e748f4..cce4c4e8 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -1114,18 +1114,18 @@ void value_t::in_place_cast(type_t cast_type)
break;
}
- case BALANCE:
+ case BALANCE: {
+ const balance_t& bal(as_balance());
switch (cast_type) {
case AMOUNT: {
- const balance_t& temp(as_balance());
- if (temp.amounts.size() == 1) {
+ if (bal.amounts.size() == 1) {
// Because we are changing the current balance value to an amount
// value, and because set_amount takes a reference (and that memory is
// about to be repurposed), we must pass in a copy.
- set_amount(amount_t((*temp.amounts.begin()).second));
+ set_amount(amount_t((*bal.amounts.begin()).second));
return;
}
- else if (temp.amounts.size() == 0) {
+ else if (bal.amounts.size() == 0) {
set_amount(0L);
return;
}
@@ -1135,10 +1135,17 @@ void value_t::in_place_cast(type_t cast_type)
}
break;
}
+ case STRING:
+ if (bal.is_empty())
+ set_string("");
+ else
+ set_string(as_balance().to_string());
+ return;
default:
break;
}
break;
+ }
case STRING:
switch (cast_type) {