The formatting code no longer justifies values
This is done in the value code, which knows -- based on the value's type -- how best to apply the justification.
This commit is contained in:
parent
a9061811ce
commit
326cbea4c7
3 changed files with 7 additions and 5 deletions
|
|
@ -245,11 +245,10 @@ void format_t::format(std::ostream& out_str, scope_t& scope)
|
||||||
else
|
else
|
||||||
out << std::right;
|
out << std::right;
|
||||||
|
|
||||||
if (elem->min_width > 0)
|
|
||||||
out.width(elem->min_width);
|
|
||||||
|
|
||||||
switch (elem->type) {
|
switch (elem->type) {
|
||||||
case element_t::STRING:
|
case element_t::STRING:
|
||||||
|
if (elem->min_width > 0)
|
||||||
|
out.width(elem->min_width);
|
||||||
out << elem->chars;
|
out << elem->chars;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,10 @@ report_t::report_t(session_t& _session)
|
||||||
"%(entry.cleared ? \" *\" : (entry.pending ? \" !\" : \"\"))"
|
"%(entry.cleared ? \" *\" : (entry.pending ? \" !\" : \"\"))"
|
||||||
"%(code ? \" (\" + code + \")\" : \"\") %(payee)%(entry.comment | \"\")\n"
|
"%(code ? \" (\" + code + \")\" : \"\") %(payee)%(entry.comment | \"\")\n"
|
||||||
" %(entry.uncleared ? (cleared ? \"* \" : (pending ? \"! \" : \"\")) : \"\")"
|
" %(entry.uncleared ? (cleared ? \"* \" : (pending ? \"! \" : \"\")) : \"\")"
|
||||||
"%-23(account)"
|
"%-34(account)"
|
||||||
" %12(calculated ? \"\" : amount)%(comment | \"\")\n%/"
|
" %12(calculated ? \"\" : amount)%(comment | \"\")\n%/"
|
||||||
" %(entry.uncleared ? (cleared ? \"* \" : (pending ? \"! \" : \"\")) : \"\")"
|
" %(entry.uncleared ? (cleared ? \"* \" : (pending ? \"! \" : \"\")) : \"\")"
|
||||||
"%-23(account)"
|
"%-34(account)"
|
||||||
" %12(calculated ? \"\" : amount)%(comment | \"\")\n%/\n");
|
" %12(calculated ? \"\" : amount)%(comment | \"\")\n%/\n");
|
||||||
|
|
||||||
HANDLER(balance_format_).on(
|
HANDLER(balance_format_).on(
|
||||||
|
|
|
||||||
|
|
@ -1263,6 +1263,9 @@ void value_t::print(std::ostream& out,
|
||||||
const int latter_width,
|
const int latter_width,
|
||||||
const optional<string>& date_format) const
|
const optional<string>& date_format) const
|
||||||
{
|
{
|
||||||
|
if (first_width > 0 && ! is_amount() && ! is_balance())
|
||||||
|
out.width(first_width);
|
||||||
|
|
||||||
switch (type()) {
|
switch (type()) {
|
||||||
case VOID:
|
case VOID:
|
||||||
out << "";
|
out << "";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue