From f27d7776ca8fb29c5a523c859d64f3c570ce8985 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 4 Jan 2017 12:02:15 -0800 Subject: Item sorting should have access to the report scope --- src/compare.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/compare.cc') diff --git a/src/compare.cc b/src/compare.cc index 547acc18..f0edff76 100644 --- a/src/compare.cc +++ b/src/compare.cc @@ -33,8 +33,10 @@ #include "compare.h" #include "op.h" +#include "scope.h" #include "post.h" #include "account.h" +#include "report.h" namespace ledger { @@ -64,6 +66,20 @@ void push_sort_value(std::list& sort_values, } } +template <> +void compare_items::find_sort_values( + std::list& 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::find_sort_values( + std::list& 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::operator()(post_t * left, post_t * right) { -- cgit v1.2.3