diff options
author | John Wiegley <johnw@newartisans.com> | 2008-08-10 03:49:03 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-08-10 03:49:03 -0400 |
commit | ace4b65487c08137c832979052236ee424448afa (patch) | |
tree | 2ac4854638d9ff17dd65d85a3399aab9cd94ac06 /src/format.h | |
parent | 548a03e725752d2a61a76fb3d3ebb736f88c0afa (diff) | |
download | fork-ledger-ace4b65487c08137c832979052236ee424448afa.tar.gz fork-ledger-ace4b65487c08137c832979052236ee424448afa.tar.bz2 fork-ledger-ace4b65487c08137c832979052236ee424448afa.zip |
The register report is now mostly displaying multi-line balances correctly.
It still shows lots even when --lots isn't specified, though.
Diffstat (limited to 'src/format.h')
-rw-r--r-- | src/format.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/format.h b/src/format.h index 31f2bb1d..ff33e2d7 100644 --- a/src/format.h +++ b/src/format.h @@ -41,21 +41,17 @@ DECLARE_EXCEPTION(format_error, std::runtime_error); class format_t : public noncopyable { - struct element_t : public noncopyable + struct element_t : public supports_flags<>, public noncopyable { #define ELEMENT_ALIGN_LEFT 0x01 -#define ELEMENT_HIGHLIGHT 0x02 +#define ELEMENT_FORMATTED 0x02 enum kind_t { STRING, EXPR, -#if 0 - DEPTH_SPACER -#endif }; kind_t type; - unsigned char flags; unsigned char min_width; unsigned char max_width; string chars; @@ -64,7 +60,7 @@ class format_t : public noncopyable scoped_ptr<struct element_t> next; element_t() throw() - : type(STRING), flags(false), min_width(0), max_width(0) { + : supports_flags<>(), type(STRING), min_width(0), max_width(0) { TRACE_CTOR(element_t, ""); } ~element_t() throw() { @@ -76,7 +72,7 @@ class format_t : public noncopyable out.width(0); out << "\e[31m"; - if (elem->flags & ELEMENT_ALIGN_LEFT) + if (elem->has_flags(ELEMENT_ALIGN_LEFT)) out << std::left; else out << std::right; |