# HG changeset patch # User Chris Cannam # Date 1222700803 0 # Node ID aa190a6a2625a2b982985815880b662dec69a5fc # Parent 55cff2c6e4a0a0246ac53a7d464e7637add299e9 * More SelectableLabel and TransformFinder tweaking diff -r 55cff2c6e4a0 -r aa190a6a2625 transform/TransformFactory.cpp --- a/transform/TransformFactory.cpp Thu Sep 25 12:44:23 2008 +0000 +++ b/transform/TransformFactory.cpp Mon Sep 29 15:06:43 2008 +0000 @@ -24,6 +24,8 @@ #include "vamp-sdk/PluginHostAdapter.h" #include "vamp-sdk/hostext/PluginWrapper.h" +#include "base/XmlExportable.h" + #include #include @@ -892,16 +894,16 @@ if (end == len) match.score += 1; if (start > prevEnd + 14) { -// cerr << "start = " << start << ", prevEnd = " <" + s.left(klen + 10).right(klen) + ""; -// cerr << "s = " << s.toStdString() << endl; + s = XmlExportable::encodeEntities(s.left(10)) + "" + + XmlExportable::encodeEntities(s.left(klen + 10).right(klen)) + + ""; fragment += tr("...%1").arg(s); -// cerr << "fragment = " << fragment.toStdString() << endl; } else { QString s = text.right(len - prevEnd); - s = s.left(start - prevEnd) + "" + s.left(end - prevEnd).right(klen) + ""; + s = XmlExportable::encodeEntities(s.left(start - prevEnd)) + "" + + XmlExportable::encodeEntities(s.left(end - prevEnd).right(klen)) + + ""; fragment += s; } @@ -910,7 +912,8 @@ if (prevEnd > 0 && prevEnd < len) { int n = len - prevEnd; - fragment += text.right(n).left(n < 8 ? n : 8); + fragment += + XmlExportable::encodeEntities(text.right(n).left(n < 8 ? n : 8)); } if (fragment != "") { diff -r 55cff2c6e4a0 -r aa190a6a2625 transform/TransformFactory.h --- a/transform/TransformFactory.h Thu Sep 25 12:44:23 2008 +0000 +++ b/transform/TransformFactory.h Mon Sep 29 15:06:43 2008 +0000 @@ -53,7 +53,7 @@ Match(const Match &m) : transform(m.transform), score(m.score), fragments(m.fragments) { } - bool operator<(const Match &m) const; + bool operator<(const Match &m) const; // sort by score first }; typedef std::map SearchResults;