summaryrefslogtreecommitdiff
path: root/src/post.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-13 00:03:56 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-13 00:03:56 -0500
commit59cbcf703c407833e4bdb07aa53a8ad6c20c292c (patch)
tree299e013a543fe3c06534ed7005d18eb71e8e9b2f /src/post.h
parent72fc1824d01bb4fe50405ed183afb57b0e129d69 (diff)
downloadfork-ledger-59cbcf703c407833e4bdb07aa53a8ad6c20c292c.tar.gz
fork-ledger-59cbcf703c407833e4bdb07aa53a8ad6c20c292c.tar.bz2
fork-ledger-59cbcf703c407833e4bdb07aa53a8ad6c20c292c.zip
post_t's copy constructor wasn't copying xdata_
Diffstat (limited to 'src/post.h')
-rw-r--r--src/post.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/post.h b/src/post.h
index 7d93b1cc..aecd65cf 100644
--- a/src/post.h
+++ b/src/post.h
@@ -95,6 +95,7 @@ public:
xdata_(post.xdata_)
{
TRACE_CTOR(post_t, "copy");
+ copy_details(post);
}
virtual ~post_t() {
TRACE_DTOR(post_t);
@@ -141,6 +142,12 @@ public:
std::size_t xact_id() const;
std::size_t account_id() const;
+ virtual void copy_details(const item_t& item) {
+ const post_t& post(dynamic_cast<const post_t&>(item));
+ xdata_ = post.xdata_;
+ item_t::copy_details(item);
+ }
+
bool valid() const;
struct xdata_t : public supports_flags<uint_least16_t>