Removed the %! formatting code, as it does nothing

This commit is contained in:
John Wiegley 2009-02-15 16:42:14 -04:00
parent 6f7f87699c
commit 20475478a4
3 changed files with 8 additions and 13 deletions

View file

@ -136,14 +136,11 @@ format_t::element_t * format_t::parse_elements(const string& fmt)
}
++p;
while (*p == '!' || *p == '-') {
while (*p == '-') {
switch (*p) {
case '-':
current->add_flags(ELEMENT_ALIGN_LEFT);
break;
case '!':
current->add_flags(ELEMENT_FORMATTED);
break;
}
++p;
}
@ -283,8 +280,7 @@ void format_t::format(std::ostream& out_str, scope_t& scope)
unistring temp(out.str());
string result;
if (! elem->has_flags(ELEMENT_FORMATTED) &&
elem->max_width > 0 && elem->max_width < temp.length()) {
if (elem->max_width > 0 && elem->max_width < temp.length()) {
result = truncate(temp, elem->max_width);
} else {
result = temp.extract();

View file

@ -65,7 +65,6 @@ class format_t : public noncopyable
struct element_t : public supports_flags<>, public noncopyable
{
#define ELEMENT_ALIGN_LEFT 0x01
#define ELEMENT_FORMATTED 0x02
enum kind_t {
STRING,

View file

@ -48,16 +48,16 @@ report_t::report_t(session_t& _session)
HANDLER(register_format_).on(
"%-.9(date) %-.20(payee)"
" %-.23(truncate(account, 23, 2))"
" %!12(print_balance(strip(display_amount), 12, 67))"
" %!12(print_balance(strip(display_total), 12, 80, true))\n%/"
" %12(print_balance(strip(display_amount), 12, 67))"
" %12(print_balance(strip(display_total), 12, 80, true))\n%/"
"%31|%-.23(truncate(account, 23, 2))"
" %!12(print_balance(strip(display_amount), 12, 67))"
" %!12(print_balance(strip(display_total), 12, 80, true))\n");
" %12(print_balance(strip(display_amount), 12, 67))"
" %12(print_balance(strip(display_total), 12, 80, true))\n");
// jww (2009-02-06): Most of these still need to be defined
HANDLER(wide_register_format_).on(
"%-.9D %-.35P %-.39A %22.108t %!22.132T\n%/"
"%48|%-.38A %22.108t %!22.132T\n");
"%-.9D %-.35P %-.39A %22.108t %22.132T\n%/"
"%48|%-.38A %22.108t %22.132T\n");
HANDLER(print_format_).on(
"%(format_date(entry.date, \"%Y/%m/%d\"))"