summaryrefslogtreecommitdiff
path: root/src/compare.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/compare.cc')
-rw-r--r--src/compare.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/compare.cc b/src/compare.cc
index 547acc18..63b85154 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-2018, 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);