Mercurial > hg > svcore
comparison 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 |
comparison
equal
deleted
inserted
replaced
443:381ec750eeee | 444:14521503f196 |
---|---|
912 int n = len - prevEnd; | 912 int n = len - prevEnd; |
913 fragment += text.right(n).left(n < 8 ? n : 8); | 913 fragment += text.right(n).left(n < 8 ? n : 8); |
914 } | 914 } |
915 | 915 |
916 if (fragment != "") { | 916 if (fragment != "") { |
917 fragment = tr("%1: %2").arg(textType).arg(fragment); | 917 match.fragments[textType] = fragment; |
918 match.fragments << fragment; | 918 } |
919 } | 919 } |
920 } | 920 |
921 | 921 bool |
922 TransformFactory::Match::operator<(const Match &m) const | |
923 { | |
924 if (score != m.score) { | |
925 return score < m.score; | |
926 } | |
927 if (transform != m.transform) { | |
928 return transform < m.transform; | |
929 } | |
930 if (fragments.size() != m.fragments.size()) { | |
931 return fragments.size() < m.fragments.size(); | |
932 } | |
933 | |
934 for (FragmentMap::const_iterator | |
935 i = fragments.begin(), | |
936 j = m.fragments.begin(); | |
937 i != fragments.end(); ++i, ++j) { | |
938 if (i->first != j->first) return i->first < j->first; | |
939 if (i->second != j->second) return i->second < j->second; | |
940 } | |
941 | |
942 return false; | |
943 } | |
944 |