diff transform/TransformFactory.cpp @ 444:14521503f196

* Start work on TransformFinder dialog
author Chris Cannam
date Tue, 23 Sep 2008 13:39:25 +0000
parents 381ec750eeee
children aa190a6a2625
line wrap: on
line diff
--- a/transform/TransformFactory.cpp	Mon Sep 22 15:44:03 2008 +0000
+++ b/transform/TransformFactory.cpp	Tue Sep 23 13:39:25 2008 +0000
@@ -914,8 +914,31 @@
     }
 
     if (fragment != "") {
-        fragment = tr("%1: %2").arg(textType).arg(fragment);
-        match.fragments << fragment;
+        match.fragments[textType] = fragment;
     }
 }
 
+bool
+TransformFactory::Match::operator<(const Match &m) const
+{
+    if (score != m.score) {
+        return score < m.score;
+    }
+    if (transform != m.transform) {
+        return transform < m.transform;
+    }
+    if (fragments.size() != m.fragments.size()) {
+        return fragments.size() < m.fragments.size();
+    }
+
+    for (FragmentMap::const_iterator
+             i = fragments.begin(),
+             j = m.fragments.begin();
+         i != fragments.end(); ++i, ++j) {
+        if (i->first != j->first) return i->first < j->first;
+        if (i->second != j->second) return i->second < j->second;
+    }
+
+    return false;
+}
+