summaryrefslogtreecommitdiff
path: root/src/format.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-05 05:02:11 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-03-05 05:03:53 -0600
commit5abbf445833f985f2aa22bde57d47cd9f83d0c92 (patch)
tree083f3520a68edd1ec7445bd74dc16f42aa1eef9c /src/format.cc
parent3ea5d88eb3ddfd8cac248fe96fdaa293e3b5bf70 (diff)
downloadfork-ledger-5abbf445833f985f2aa22bde57d47cd9f83d0c92.tar.gz
fork-ledger-5abbf445833f985f2aa22bde57d47cd9f83d0c92.tar.bz2
fork-ledger-5abbf445833f985f2aa22bde57d47cd9f83d0c92.zip
Corrected copy of format_t objects
Copying of sub-elements was causing pointer overlap.
Diffstat (limited to 'src/format.cc')
-rw-r--r--src/format.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/format.cc b/src/format.cc
index 4ff1fc19..97dcfb22 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -40,6 +40,17 @@ namespace ledger {
format_t::elision_style_t format_t::default_style = TRUNCATE_TRAILING;
bool format_t::default_style_changed = false;
+format_t::element_t::element_t(const element_t& elem)
+ : supports_flags<>(),
+ type(elem.type),
+ min_width(elem.min_width),
+ max_width(elem.max_width),
+ data(elem.data),
+ next(elem.next ? new element_t(*elem.next) : NULL)
+{
+ TRACE_CTOR(element_t, "copy");
+}
+
void format_t::element_t::dump(std::ostream& out) const
{
out << "Element: ";