diff options
author | Craig Earls <enderw88@gmail.com> | 2011-10-06 22:07:01 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2011-10-06 22:07:01 -0700 |
commit | b400d65be082165f44e769605aa6a78133cf6d9a (patch) | |
tree | 27b18ee35a5c4f60a10cf4f626e15ac30276040b /src/convert.cc | |
parent | e9ccb012c2c5ffe0e9f4916ee859bda95d9d4248 (diff) | |
parent | f0791bbd7297e737d9e13d0b0bb21473b173b2a7 (diff) | |
download | fork-ledger-b400d65be082165f44e769605aa6a78133cf6d9a.tar.gz fork-ledger-b400d65be082165f44e769605aa6a78133cf6d9a.tar.bz2 fork-ledger-b400d65be082165f44e769605aa6a78133cf6d9a.zip |
Merge remote branch 'upstream/next' into next
Diffstat (limited to 'src/convert.cc')
-rw-r--r-- | src/convert.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/convert.cc b/src/convert.cc index 5d3f23fa..493fbb7a 100644 --- a/src/convert.cc +++ b/src/convert.cc @@ -62,10 +62,10 @@ value_t convert_command(call_scope_t& args) post_map_t post_map; xacts_iterator journal_iter(journal); - while (xact_t * xact = journal_iter()) { + while (xact_t * xact = *journal_iter++) { post_t * post = NULL; xact_posts_iterator xact_iter(*xact); - while ((post = xact_iter()) != NULL) { + while ((post = *xact_iter++) != NULL) { if (post->account == bucket) break; } @@ -95,7 +95,7 @@ value_t convert_command(call_scope_t& args) foreach (post_t * post, xact->posts) post->amount.in_place_negate(); } - + bool matched = false; if (! xact->posts.front()->amount.is_null()) { post_map_t::iterator i = post_map.find(- xact->posts.front()->amount); @@ -121,14 +121,10 @@ value_t convert_command(call_scope_t& args) } else { if (xact->posts.front()->account == NULL) { - xacts_iterator xi; - xi.xacts_i = current_xacts.begin(); - xi.xacts_end = current_xacts.end(); - xi.xacts_uninitialized = false; - // jww (2010-03-07): Bind this logic to an option: --auto-match if (account_t * acct = - lookup_probable_account(xact->payee, xi, bucket).second) + lookup_probable_account(xact->payee, current_xacts.rbegin(), + current_xacts.rend(), bucket).second) xact->posts.front()->account = acct; else xact->posts.front()->account = unknown; @@ -141,7 +137,7 @@ value_t convert_command(call_scope_t& args) } else { xact_posts_iterator xact_iter(*xact); - while (post_t * post = xact_iter()) + while (post_t * post = *xact_iter++) formatter(*post); } } |