diff options
Diffstat (limited to 'src')
126 files changed, 210 insertions, 179 deletions
diff --git a/src/account.cc b/src/account.cc index 2a48eaf5..14e8b0a9 100644 --- a/src/account.cc +++ b/src/account.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/account.h b/src/account.h index 4a4e859d..e8f28596 100644 --- a/src/account.h +++ b/src/account.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/amount.cc b/src/amount.cc index 52ccbc88..0244de66 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/amount.h b/src/amount.h index 8885a69d..90a13a59 100644 --- a/src/amount.h +++ b/src/amount.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/annotate.cc b/src/annotate.cc index e953f441..22b01364 100644 --- a/src/annotate.cc +++ b/src/annotate.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/annotate.h b/src/annotate.h index 0ea2561b..8c2382de 100644 --- a/src/annotate.h +++ b/src/annotate.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/balance.cc b/src/balance.cc index ca14c7ff..3cfbe55f 100644 --- a/src/balance.cc +++ b/src/balance.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/balance.h b/src/balance.h index d68fccc8..d63b771c 100644 --- a/src/balance.h +++ b/src/balance.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/chain.cc b/src/chain.cc index 94afc0fa..b913a4e3 100644 --- a/src/chain.cc +++ b/src/chain.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -186,9 +186,9 @@ post_handler_ptr chain_post_handlers(post_handler_ptr base_handler, // value expression. if (report.HANDLED(sort_)) { if (report.HANDLED(sort_xacts_)) - handler.reset(new sort_xacts(handler, report.HANDLER(sort_).str())); + handler.reset(new sort_xacts(handler, expr_t(report.HANDLER(sort_).str()), report)); else - handler.reset(new sort_posts(handler, report.HANDLER(sort_).str())); + handler.reset(new sort_posts(handler, report.HANDLER(sort_).str(), report)); } // collapse_posts causes xacts with multiple posts to appear as xacts diff --git a/src/chain.h b/src/chain.h index 16fb4400..69de57f0 100644 --- a/src/chain.h +++ b/src/chain.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/commodity.cc b/src/commodity.cc index 1475f52e..47093ba3 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/commodity.h b/src/commodity.h index 1741bfaf..fd09ea46 100644 --- a/src/commodity.h +++ b/src/commodity.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/compare.cc b/src/compare.cc index 547acc18..8254527b 100644 --- a/src/compare.cc +++ b/src/compare.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,8 +33,10 @@ #include "compare.h" #include "op.h" +#include "scope.h" #include "post.h" #include "account.h" +#include "report.h" namespace ledger { @@ -65,6 +67,20 @@ void push_sort_value(std::list<sort_value_t>& sort_values, } template <> +void compare_items<post_t>::find_sort_values( + std::list<sort_value_t>& sort_values, scope_t& scope) { + bind_scope_t bound_scope(report, scope); + push_sort_value(sort_values, sort_order.get_op(), bound_scope); +} + +template <> +void compare_items<account_t>::find_sort_values( + std::list<sort_value_t>& sort_values, scope_t& scope) { + bind_scope_t bound_scope(report, scope); + push_sort_value(sort_values, sort_order.get_op(), bound_scope); +} + +template <> bool compare_items<post_t>::operator()(post_t * left, post_t * right) { assert(left); diff --git a/src/compare.h b/src/compare.h index baee6075..6a2f68cf 100644 --- a/src/compare.h +++ b/src/compare.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -48,6 +48,7 @@ namespace ledger { class post_t; class account_t; +class report_t; void push_sort_value(std::list<sort_value_t>& sort_values, expr_t::ptr_op_t node, scope_t& scope); @@ -56,23 +57,24 @@ template <typename T> class compare_items { expr_t sort_order; + report_t& report; compare_items(); public: - compare_items(const compare_items& other) : sort_order(other.sort_order) { - TRACE_CTOR(compare_items, "copy"); + compare_items(const expr_t& _sort_order, report_t& _report) : + sort_order(_sort_order), report(_report) { + TRACE_CTOR(compare_items, "const value_expr&, report_t&"); } - compare_items(const expr_t& _sort_order) : sort_order(_sort_order) { - TRACE_CTOR(compare_items, "const value_expr&"); + compare_items(const compare_items& other) : + sort_order(other.sort_order), report(other.report) { + TRACE_CTOR(compare_items, "copy"); } ~compare_items() throw() { TRACE_DTOR(compare_items); } - void find_sort_values(std::list<sort_value_t>& sort_values, scope_t& scope) { - push_sort_value(sort_values, sort_order.get_op(), scope); - } + void find_sort_values(std::list<sort_value_t>& sort_values, scope_t& scope); bool operator()(T * left, T * right); }; diff --git a/src/context.h b/src/context.h index 61797dc4..f4f772b0 100644 --- a/src/context.h +++ b/src/context.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/convert.cc b/src/convert.cc index d0a0dc39..ae965a08 100644 --- a/src/convert.cc +++ b/src/convert.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/convert.h b/src/convert.h index cb6bcd71..8945112f 100644 --- a/src/convert.h +++ b/src/convert.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/draft.cc b/src/draft.cc index f7557373..b8f162e4 100644 --- a/src/draft.cc +++ b/src/draft.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/draft.h b/src/draft.h index f4c24c26..49ea9a47 100644 --- a/src/draft.h +++ b/src/draft.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/emacs.cc b/src/emacs.cc index 9f2626a3..17d3a590 100644 --- a/src/emacs.cc +++ b/src/emacs.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/emacs.h b/src/emacs.h index 52b7bd37..55cc697c 100644 --- a/src/emacs.h +++ b/src/emacs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/error.cc b/src/error.cc index 4b3565a3..92203d11 100644 --- a/src/error.cc +++ b/src/error.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/error.h b/src/error.h index 73a0e395..4df74cfc 100644 --- a/src/error.h +++ b/src/error.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/expr.cc b/src/expr.cc index bc877c1a..1faf9917 100644 --- a/src/expr.cc +++ b/src/expr.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/exprbase.h b/src/exprbase.h index 6d13c429..72694008 100644 --- a/src/exprbase.h +++ b/src/exprbase.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/filters.cc b/src/filters.cc index 8aa1218b..4a1a5c30 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -154,7 +154,7 @@ void truncate_xacts::operator()(post_t& post) void sort_posts::post_accumulated_posts() { std::stable_sort(posts.begin(), posts.end(), - compare_items<post_t>(sort_order)); + compare_items<post_t>(sort_order, report)); foreach (post_t * post, posts) { post->xdata().drop_flags(POST_EXT_SORT_CALC); diff --git a/src/filters.h b/src/filters.h index 4aa8af7a..8b1f8d2a 100644 --- a/src/filters.h +++ b/src/filters.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -237,17 +237,20 @@ class sort_posts : public item_handler<post_t> posts_deque posts; expr_t sort_order; + report_t& report; sort_posts(); public: - sort_posts(post_handler_ptr handler, const expr_t& _sort_order) - : item_handler<post_t>(handler), sort_order(_sort_order) { - TRACE_CTOR(sort_posts, "post_handler_ptr, const value_expr&"); + sort_posts(post_handler_ptr handler, const expr_t& _sort_order, + report_t& _report) + : item_handler<post_t>(handler), sort_order(_sort_order), report(_report) { + TRACE_CTOR(sort_posts, "post_handler_ptr, const value_expr&, report_t&"); } - sort_posts(post_handler_ptr handler, const string& _sort_order) - : item_handler<post_t>(handler), sort_order(_sort_order) { - TRACE_CTOR(sort_posts, "post_handler_ptr, const string&"); + sort_posts(post_handler_ptr handler, const string& _sort_order, + report_t& _report) + : item_handler<post_t>(handler), sort_order(_sort_order), report(_report) { + TRACE_CTOR(sort_posts, "post_handler_ptr, const string&, report_t&"); } virtual ~sort_posts() { TRACE_DTOR(sort_posts); @@ -280,15 +283,17 @@ class sort_xacts : public item_handler<post_t> sort_xacts(); public: - sort_xacts(post_handler_ptr handler, const expr_t& _sort_order) - : sorter(handler, _sort_order) { + sort_xacts(post_handler_ptr handler, const expr_t& _sort_order, + report_t& _report) + : sorter(handler, _sort_order, _report) { TRACE_CTOR(sort_xacts, - "post_handler_ptr, const value_expr&"); + "post_handler_ptr, const value_expr&, report_t&"); } - sort_xacts(post_handler_ptr handler, const string& _sort_order) - : sorter(handler, _sort_order) { + sort_xacts(post_handler_ptr handler, const string& _sort_order, + report_t& _report) + : sorter(handler, _sort_order, _report) { TRACE_CTOR(sort_xacts, - "post_handler_ptr, const string&"); + "post_handler_ptr, const string&, report_t&"); } virtual ~sort_xacts() { TRACE_DTOR(sort_xacts); diff --git a/src/flags.h b/src/flags.h index e6b66470..91b8838f 100644 --- a/src/flags.h +++ b/src/flags.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/format.cc b/src/format.cc index b6f0d5ae..9b137296 100644 --- a/src/format.cc +++ b/src/format.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/format.h b/src/format.h index 8856905d..c63075c7 100644 --- a/src/format.h +++ b/src/format.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/generate.cc b/src/generate.cc index c1ecb007..9a7d9317 100644 --- a/src/generate.cc +++ b/src/generate.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/generate.h b/src/generate.h index d4f13070..756a7097 100644 --- a/src/generate.h +++ b/src/generate.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/global.cc b/src/global.cc index 882840de..37765a9b 100644 --- a/src/global.cc +++ b/src/global.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -136,9 +136,7 @@ void global_scope_t::read_init() path init_file; if (HANDLED(init_file_)) { init_file=HANDLER(init_file_).str(); - if (exists(init_file)) { - parse_init(init_file); - } else { + if (!exists(init_file)) { throw_(parse_error, _f("Could not find specified init file %1%") % init_file); } } else { diff --git a/src/global.h b/src/global.h index 1a4a3076..b35fa653 100644 --- a/src/global.h +++ b/src/global.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -129,7 +129,7 @@ public: out << '-' << Ledger_VERSION_DATE; out << _(", the command-line accounting tool"); out << - _("\n\nCopyright (c) 2003-2016, John Wiegley. All rights reserved.\n\n\ + _("\n\nCopyright (c) 2003-2017, John Wiegley. All rights reserved.\n\n\ This program is made available under the terms of the BSD Public License.\n\ See LICENSE file included with the distribution for details and disclaimer."); out << std::endl; diff --git a/src/history.cc b/src/history.cc index 25d42b06..48f3a80e 100644 --- a/src/history.cc +++ b/src/history.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/history.h b/src/history.h index 37efb068..06cda7a8 100644 --- a/src/history.h +++ b/src/history.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/item.cc b/src/item.cc index 0402f467..e56a29b6 100644 --- a/src/item.cc +++ b/src/item.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/iterators.cc b/src/iterators.cc index 88233ea1..222ba10d 100644 --- a/src/iterators.cc +++ b/src/iterators.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -201,7 +201,7 @@ void sorted_accounts_iterator::push_back(account_t& account) std::stable_sort(accounts_list.back().begin(), accounts_list.back().end(), - compare_items<account_t>(sort_cmp)); + compare_items<account_t>(sort_cmp, report)); #if DEBUG_ON if (SHOW_DEBUG("account.sorted")) { @@ -234,7 +234,7 @@ void sorted_accounts_iterator::sort_accounts(account_t& account, deque.push_back(pair.second); std::stable_sort(deque.begin(), deque.end(), - compare_items<account_t>(sort_cmp)); + compare_items<account_t>(sort_cmp, report)); #if DEBUG_ON if (SHOW_DEBUG("account.sorted")) { diff --git a/src/iterators.h b/src/iterators.h index a3f535b1..818b0ccd 100644 --- a/src/iterators.h +++ b/src/iterators.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -50,6 +50,7 @@ namespace ledger { class journal_t; +class report_t; template <typename Derived, typename Value, typename CategoryOrTraversal> class iterator_facade_base @@ -279,8 +280,9 @@ class sorted_accounts_iterator : public iterator_facade_base<sorted_accounts_iterator, account_t *, boost::forward_traversal_tag> { - expr_t sort_cmp; - bool flatten_all; + expr_t sort_cmp; + report_t& report; + bool flatten_all; typedef std::deque<account_t *> accounts_deque_t; @@ -290,16 +292,21 @@ class sorted_accounts_iterator public: sorted_accounts_iterator(account_t& account, - const expr_t& _sort_cmp, bool _flatten_all) - : sort_cmp(_sort_cmp), flatten_all(_flatten_all) { + const expr_t& _sort_cmp, + report_t& _report, + bool _flatten_all) + : sort_cmp(_sort_cmp), report(_report), + flatten_all(_flatten_all) { push_back(account); increment(); - TRACE_CTOR(sorted_accounts_iterator, "account_t&, expr_t, bool"); + TRACE_CTOR(sorted_accounts_iterator, + "account_t&, expr_t, report_t&, bool"); } sorted_accounts_iterator(const sorted_accounts_iterator& i) : iterator_facade_base<sorted_accounts_iterator, account_t *, boost::forward_traversal_tag>(i), - sort_cmp(i.sort_cmp), flatten_all(i.flatten_all), + sort_cmp(i.sort_cmp), report(i.report), + flatten_all(i.flatten_all), accounts_list(i.accounts_list), sorted_accounts_i(i.sorted_accounts_i), sorted_accounts_end(i.sorted_accounts_end) { diff --git a/src/journal.cc b/src/journal.cc index 36fe5fc0..023fd38e 100644 --- a/src/journal.cc +++ b/src/journal.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/journal.h b/src/journal.h index 76e1735d..59a23f4b 100644 --- a/src/journal.h +++ b/src/journal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/lookup.cc b/src/lookup.cc index 11b7db61..8106f712 100644 --- a/src/lookup.cc +++ b/src/lookup.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/lookup.h b/src/lookup.h index 2c4e6575..f2ace5cd 100644 --- a/src/lookup.h +++ b/src/lookup.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/main.cc b/src/main.cc index 07192651..f0209ca0 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/mask.cc b/src/mask.cc index c6868dde..4c908d11 100644 --- a/src/mask.cc +++ b/src/mask.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/option.cc b/src/option.cc index 7c5c5e07..f9de9102 100644 --- a/src/option.cc +++ b/src/option.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/option.h b/src/option.h index b06c1754..c588dfce 100644 --- a/src/option.h +++ b/src/option.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/output.cc b/src/output.cc index 418140ae..2a8c8201 100644 --- a/src/output.cc +++ b/src/output.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -332,18 +332,19 @@ void report_tags::flush() void report_tags::gather_metadata(item_t& item) { - if (item.metadata) - foreach (const item_t::string_map::value_type& data, *item.metadata) { - string tag(data.first); - if (report.HANDLED(values) && data.second.first) - tag += ": " + data.second.first.get().to_string(); - - std::map<string, std::size_t>::iterator i = tags.find(tag); - if (i == tags.end()) - tags.insert(tags_pair(tag, 1)); - else - (*i).second++; - } + if (! item.metadata) + return; + foreach (const item_t::string_map::value_type& data, *item.metadata) { + string tag(data.first); + if (report.HANDLED(values) && data.second.first) + tag += ": " + data.second.first.get().to_string(); + + std::map<string, std::size_t>::iterator i = tags.find(tag); + if (i == tags.end()) + tags.insert(tags_pair(tag, 1)); + else + (*i).second++; + } } void report_tags::operator()(post_t& post) diff --git a/src/output.h b/src/output.h index ea474e2b..40276ccb 100644 --- a/src/output.h +++ b/src/output.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/parser.cc b/src/parser.cc index 53b03a0c..7f942a15 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/parser.h b/src/parser.h index 913179a1..31b070c5 100644 --- a/src/parser.h +++ b/src/parser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/pool.cc b/src/pool.cc index dff02df8..931a1708 100644 --- a/src/pool.cc +++ b/src/pool.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/post.cc b/src/post.cc index 8d2693c7..7b8763d6 100644 --- a/src/post.cc +++ b/src/post.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/precmd.cc b/src/precmd.cc index af8c5ee0..d0ab4d82 100644 --- a/src/precmd.cc +++ b/src/precmd.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/precmd.h b/src/precmd.h index 365cc1ba..ed168b10 100644 --- a/src/precmd.h +++ b/src/precmd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/predicate.h b/src/predicate.h index aca44452..258a23af 100644 --- a/src/predicate.h +++ b/src/predicate.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/print.cc b/src/print.cc index 0cc23275..e52fae1b 100644 --- a/src/print.cc +++ b/src/print.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/print.h b/src/print.h index 70b26d65..ff4b8e7e 100644 --- a/src/print.h +++ b/src/print.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/pstream.h b/src/pstream.h index fc7fc8ca..a0cb47a0 100644 --- a/src/pstream.h +++ b/src/pstream.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/ptree.cc b/src/ptree.cc index 534db003..9c748bc9 100644 --- a/src/ptree.cc +++ b/src/ptree.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/ptree.h b/src/ptree.h index ca7b46e2..bf41c54f 100644 --- a/src/ptree.h +++ b/src/ptree.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_account.cc b/src/py_account.cc index c4a9ae07..0ebe737c 100644 --- a/src/py_account.cc +++ b/src/py_account.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_amount.cc b/src/py_amount.cc index 8a8ea871..f3e0d7e0 100644 --- a/src/py_amount.cc +++ b/src/py_amount.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_balance.cc b/src/py_balance.cc index 6a6c59fb..b608ed69 100644 --- a/src/py_balance.cc +++ b/src/py_balance.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_commodity.cc b/src/py_commodity.cc index c457e64d..a262dc16 100644 --- a/src/py_commodity.cc +++ b/src/py_commodity.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_expr.cc b/src/py_expr.cc index de3ac925..68b38459 100644 --- a/src/py_expr.cc +++ b/src/py_expr.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_format.cc b/src/py_format.cc index 4dcd4ba3..9123bfb0 100644 --- a/src/py_format.cc +++ b/src/py_format.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_item.cc b/src/py_item.cc index 644b11f1..6f412c9d 100644 --- a/src/py_item.cc +++ b/src/py_item.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_journal.cc b/src/py_journal.cc index 879f9548..ac923cca 100644 --- a/src/py_journal.cc +++ b/src/py_journal.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_post.cc b/src/py_post.cc index 85d4701a..fb50a7c4 100644 --- a/src/py_post.cc +++ b/src/py_post.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_session.cc b/src/py_session.cc index 0ddf66d2..7aa54959 100644 --- a/src/py_session.cc +++ b/src/py_session.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_times.cc b/src/py_times.cc index be3e4f31..f7270dcf 100644 --- a/src/py_times.cc +++ b/src/py_times.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_utils.cc b/src/py_utils.cc index 731294b2..9bb110f1 100644 --- a/src/py_utils.cc +++ b/src/py_utils.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_value.cc b/src/py_value.cc index 655337ba..922fbf8d 100644 --- a/src/py_value.cc +++ b/src/py_value.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/py_xact.cc b/src/py_xact.cc index f7283989..f0884b7d 100644 --- a/src/py_xact.cc +++ b/src/py_xact.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/pyfstream.h b/src/pyfstream.h index a90b121c..1da9ad7c 100644 --- a/src/pyfstream.h +++ b/src/pyfstream.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/pyinterp.cc b/src/pyinterp.cc index 81924c86..22f925c6 100644 --- a/src/pyinterp.cc +++ b/src/pyinterp.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/pyinterp.h b/src/pyinterp.h index 9c24b0cf..d719b198 100644 --- a/src/pyinterp.h +++ b/src/pyinterp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/pyledger.cc b/src/pyledger.cc index a516f66d..878cd666 100644 --- a/src/pyledger.cc +++ b/src/pyledger.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/pyutils.h b/src/pyutils.h index 07ce7bdd..b4b07a36 100644 --- a/src/pyutils.h +++ b/src/pyutils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/query.cc b/src/query.cc index a2117cfe..3f6c4873 100644 --- a/src/query.cc +++ b/src/query.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/query.h b/src/query.h index cbfac6bc..ad76c53c 100644 --- a/src/query.h +++ b/src/query.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/quotes.cc b/src/quotes.cc index cef9b713..02f0b693 100644 --- a/src/quotes.cc +++ b/src/quotes.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/quotes.h b/src/quotes.h index b3978171..03a13df1 100644 --- a/src/quotes.h +++ b/src/quotes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/report.cc b/src/report.cc index 09cae692..2f3cc302 100644 --- a/src/report.cc +++ b/src/report.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -431,8 +431,9 @@ namespace { } else { expr_t sort_expr(report.HANDLER(sort_).str()); sort_expr.set_context(&report); - sorted_accounts_iterator iter(*report.session.journal->master, - sort_expr, report.HANDLED(flat)); + sorted_accounts_iterator iter( + *report.session.journal->master, sort_expr, report, + report.HANDLED(flat)); pass_down_accounts<sorted_accounts_iterator> (handler, iter, predicate_t(report.HANDLER(display_).str(), report.what_to_keep()), report); @@ -444,8 +445,9 @@ namespace { } else { expr_t sort_expr(report.HANDLER(sort_).str()); sort_expr.set_context(&report); - sorted_accounts_iterator iter(*report.session.journal->master, - sort_expr, report.HANDLED(flat)); + sorted_accounts_iterator iter( + *report.session.journal->master, sort_expr, report, + report.HANDLED(flat)); pass_down_accounts<sorted_accounts_iterator>(handler, iter); } } diff --git a/src/report.h b/src/report.h index 6bd3ca73..0c68b182 100644 --- a/src/report.h +++ b/src/report.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/scope.cc b/src/scope.cc index 03387549..83fddeee 100644 --- a/src/scope.cc +++ b/src/scope.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/scope.h b/src/scope.h index 147b400f..1bead5a7 100644 --- a/src/scope.h +++ b/src/scope.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/select.cc b/src/select.cc index 8e7786e6..af5815d1 100644 --- a/src/select.cc +++ b/src/select.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/select.h b/src/select.h index 89d7c989..6cff34e8 100644 --- a/src/select.h +++ b/src/select.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/session.cc b/src/session.cc index 8d03431f..deba3afa 100644 --- a/src/session.cc +++ b/src/session.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -284,7 +284,7 @@ value_t session_t::fn_str(call_scope_t& args) value_t session_t::fn_lot_price(call_scope_t& args) { - amount_t amt(args.get<amount_t>(1, false)); + amount_t amt(args.get<amount_t>(0, false)); if (amt.has_annotation() && amt.annotation().price) return *amt.annotation().price; else @@ -292,7 +292,7 @@ value_t session_t::fn_lot_price(call_scope_t& args) } value_t session_t::fn_lot_date(call_scope_t& args) { - amount_t amt(args.get<amount_t>(1, false)); + amount_t amt(args.get<amount_t>(0, false)); if (amt.has_annotation() && amt.annotation().date) return *amt.annotation().date; else @@ -300,7 +300,7 @@ value_t session_t::fn_lot_date(call_scope_t& args) } value_t session_t::fn_lot_tag(call_scope_t& args) { - amount_t amt(args.get<amount_t>(1, false)); + amount_t amt(args.get<amount_t>(0, false)); if (amt.has_annotation() && amt.annotation().tag) return string_value(*amt.annotation().tag); else diff --git a/src/session.h b/src/session.h index 3d35a93e..bb9c5f7e 100644 --- a/src/session.h +++ b/src/session.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/stats.cc b/src/stats.cc index 2d1f8dc7..88d7157d 100644 --- a/src/stats.cc +++ b/src/stats.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/stats.h b/src/stats.h index dfb9e796..57ca210a 100644 --- a/src/stats.h +++ b/src/stats.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/stream.cc b/src/stream.cc index e07fd61d..98470480 100644 --- a/src/stream.cc +++ b/src/stream.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/stream.h b/src/stream.h index 996cffb1..3400647c 100644 --- a/src/stream.h +++ b/src/stream.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/system.hh.in b/src/system.hh.in index 331f7a0e..9df9c0fc 100644 --- a/src/system.hh.in +++ b/src/system.hh.in @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/temps.cc b/src/temps.cc index b8e7bfb6..5859284c 100644 --- a/src/temps.cc +++ b/src/temps.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/temps.h b/src/temps.h index eb2b9b23..7e65e118 100644 --- a/src/temps.h +++ b/src/temps.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/textual.cc b/src/textual.cc index 456ff8af..dcb69858 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/timelog.cc b/src/timelog.cc index 870a4b4b..7004eb44 100644 --- a/src/timelog.cc +++ b/src/timelog.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/timelog.h b/src/timelog.h index 95a87eae..b1076c46 100644 --- a/src/timelog.h +++ b/src/timelog.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/times.cc b/src/times.cc index 8b0490ff..1fe9a58d 100644 --- a/src/times.cc +++ b/src/times.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/times.h b/src/times.h index df833958..fc50f4b9 100644 --- a/src/times.h +++ b/src/times.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/token.cc b/src/token.cc index f616ae3e..268c0e60 100644 --- a/src/token.cc +++ b/src/token.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/token.h b/src/token.h index b9ccde86..1bd6cd99 100644 --- a/src/token.h +++ b/src/token.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/unistring.h b/src/unistring.h index fc37c9f2..d6c3f5fd 100644 --- a/src/unistring.h +++ b/src/unistring.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/utils.cc b/src/utils.cc index fca9e6d4..145f5290 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/utils.h b/src/utils.h index d4a03a73..adc882de 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/value.cc b/src/value.cc index 878d7349..014f9e2d 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/value.h b/src/value.h index eb0c7c76..5aa2060f 100644 --- a/src/value.h +++ b/src/value.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/views.cc b/src/views.cc index 65d21a9a..be880833 100644 --- a/src/views.cc +++ b/src/views.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/views.h b/src/views.h index 070ac22d..ee195504 100644 --- a/src/views.h +++ b/src/views.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/xact.cc b/src/xact.cc index 2524889d..69887437 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2016, John Wiegley. All rights reserved. + * Copyright (c) 2003-2017, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are |