mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Uses smart_less for position() script function
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@506 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -47,7 +47,7 @@ struct OrderCache<T>::CompareValues {
|
||||
CompareValues(const vector<String>& values) : values(values) {}
|
||||
|
||||
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) {
|
||||
return lt;
|
||||
} else {
|
||||
// compare characters
|
||||
// TODO: decompose characters, in particular AE and accents
|
||||
Char la = toLower(a), lb = toLower(b);
|
||||
if (la < lb) return true;
|
||||
if (la > lb) return false;
|
||||
|
||||
Reference in New Issue
Block a user