Commit 182cdbfc authored by twanvl's avatar twanvl

Uses smart_less for position() script function

parent 16fd9c9b
...@@ -47,7 +47,7 @@ struct OrderCache<T>::CompareValues { ...@@ -47,7 +47,7 @@ struct OrderCache<T>::CompareValues {
CompareValues(const vector<String>& values) : values(values) {} CompareValues(const vector<String>& values) : values(values) {}
inline bool operator () (const KV& a, const KV& b) { inline bool operator () (const KV& a, const KV& b) {
return values[a.second] < values[b.second]; return smart_less(values[a.second], values[b.second]);
} }
}; };
......
...@@ -221,6 +221,7 @@ bool smart_less(const String& as, const String& bs) { ...@@ -221,6 +221,7 @@ bool smart_less(const String& as, const String& bs) {
return lt; return lt;
} else { } else {
// compare characters // compare characters
// TODO: decompose characters, in particular AE and accents
Char la = toLower(a), lb = toLower(b); Char la = toLower(a), lb = toLower(b);
if (la < lb) return true; if (la < lb) return true;
if (la > lb) return false; if (la > lb) return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment