summaryrefslogtreecommitdiff
path: root/src/balance.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-11 16:03:50 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-11 17:02:25 -0400
commitdea2aed0b509734ec4e1cd163ac2a4f013000da2 (patch)
tree7908da76c67ae5172882306a319bf26df81b73b4 /src/balance.cc
parentd580079df892c30d023b3211d6c4611c17b11f8f (diff)
downloadfork-ledger-dea2aed0b509734ec4e1cd163ac2a4f013000da2.tar.gz
fork-ledger-dea2aed0b509734ec4e1cd163ac2a4f013000da2.tar.bz2
fork-ledger-dea2aed0b509734ec4e1cd163ac2a4f013000da2.zip
Untabified all source files
Diffstat (limited to 'src/balance.cc')
-rw-r--r--src/balance.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/balance.cc b/src/balance.cc
index a8bc649d..7ce9d994 100644
--- a/src/balance.cc
+++ b/src/balance.cc
@@ -35,7 +35,7 @@
#include "commodity.h"
#include "annotate.h"
#include "pool.h"
-#include "unistring.h" // for justify()
+#include "unistring.h" // for justify()
namespace ledger {
@@ -71,7 +71,7 @@ balance_t& balance_t::operator+=(const amount_t& amt)
{
if (amt.is_null())
throw_(balance_error,
- _("Cannot add an uninitialized amount to a balance"));
+ _("Cannot add an uninitialized amount to a balance"));
if (amt.is_realzero())
return *this;
@@ -96,7 +96,7 @@ balance_t& balance_t::operator-=(const amount_t& amt)
{
if (amt.is_null())
throw_(balance_error,
- _("Cannot subtract an uninitialized amount from a balance"));
+ _("Cannot subtract an uninitialized amount from a balance"));
if (amt.is_realzero())
return *this;
@@ -116,7 +116,7 @@ balance_t& balance_t::operator*=(const amount_t& amt)
{
if (amt.is_null())
throw_(balance_error,
- _("Cannot multiply a balance by an uninitialized amount"));
+ _("Cannot multiply a balance by an uninitialized amount"));
if (is_realzero()) {
;
@@ -138,12 +138,12 @@ balance_t& balance_t::operator*=(const amount_t& amt)
amounts.begin()->second *= amt;
else
throw_(balance_error,
- _("Cannot multiply a balance with annotated commodities by a commoditized amount"));
+ _("Cannot multiply a balance with annotated commodities by a commoditized amount"));
}
else {
assert(amounts.size() > 1);
throw_(balance_error,
- _("Cannot multiply a multi-commodity balance by a commoditized amount"));
+ _("Cannot multiply a multi-commodity balance by a commoditized amount"));
}
return *this;
}
@@ -152,7 +152,7 @@ balance_t& balance_t::operator/=(const amount_t& amt)
{
if (amt.is_null())
throw_(balance_error,
- _("Cannot divide a balance by an uninitialized amount"));
+ _("Cannot divide a balance by an uninitialized amount"));
if (is_realzero()) {
;
@@ -174,19 +174,19 @@ balance_t& balance_t::operator/=(const amount_t& amt)
amounts.begin()->second /= amt;
else
throw_(balance_error,
- _("Cannot divide a balance with annotated commodities by a commoditized amount"));
+ _("Cannot divide a balance with annotated commodities by a commoditized amount"));
}
else {
assert(amounts.size() > 1);
throw_(balance_error,
- _("Cannot divide a multi-commodity balance by a commoditized amount"));
+ _("Cannot divide a multi-commodity balance by a commoditized amount"));
}
return *this;
}
optional<balance_t>
balance_t::value(const optional<datetime_t>& moment,
- const optional<commodity_t&>& in_terms_of) const
+ const optional<commodity_t&>& in_terms_of) const
{
balance_t temp;
bool resolved = false;
@@ -223,11 +223,11 @@ balance_t::commodity_amount(const optional<const commodity_t&>& commodity) const
// Try stripping annotations before giving an error.
balance_t temp(strip_annotations(keep_details_t()));
if (temp.amounts.size() == 1)
- return temp.commodity_amount(commodity);
+ return temp.commodity_amount(commodity);
throw_(amount_error,
- _("Requested amount of a balance with multiple commodities: %1")
- << temp);
+ _("Requested amount of a balance with multiple commodities: %1")
+ << temp);
}
}
else if (amounts.size() > 0) {
@@ -251,9 +251,9 @@ balance_t::strip_annotations(const keep_details_t& what_to_keep) const
}
void balance_t::print(std::ostream& out,
- const int first_width,
- const int latter_width,
- const uint_least8_t flags) const
+ const int first_width,
+ const int latter_width,
+ const uint_least8_t flags) const
{
bool first = true;
int lwidth = latter_width;
@@ -269,7 +269,7 @@ void balance_t::print(std::ostream& out,
sorted.push_back(&pair.second);
std::stable_sort(sorted.begin(), sorted.end(),
- commodity_t::compare_by_commodity());
+ commodity_t::compare_by_commodity());
foreach (const amount_t * amount, sorted) {
int width;
@@ -284,7 +284,7 @@ void balance_t::print(std::ostream& out,
std::ostringstream buf;
amount->print(buf, flags);
justify(out, buf.str(), width, flags & AMOUNT_PRINT_RIGHT_JUSTIFY,
- flags & AMOUNT_PRINT_COLORIZE && amount->sign() < 0);
+ flags & AMOUNT_PRINT_COLORIZE && amount->sign() < 0);
}
if (first) {