summaryrefslogtreecommitdiff
path: root/library
Side-by-side diff
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/stringutil.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/backend/stringutil.cpp b/library/backend/stringutil.cpp
index b5fbd3e..f1ad1b9 100644
--- a/library/backend/stringutil.cpp
+++ b/library/backend/stringutil.cpp
@@ -40,53 +40,53 @@ static const char collationHack[] = {
0x04, //C-D
0x05, //C-E
0x06, //C-F
0x07, //C-G
0x08, //C-H
0x09, //C-I
0x0a, //C-J
0x0b, //C-K
0x0c, //C-L
0x0d, //C-M
0x0e, //C-N
0x0f, //C-O
0x10, //C-P
0x11, //C-Q
0x12, //C-R
0x13, //C-S
0x14, //C-T
0x15, //C-U
0x16, //C-V
0x17, //C-W
0x18, //C-X
0x19, //C-Y
0x1a, //C-Z
0x1b, //C-[
-0x1c, //C-\
+0x1c, /* C-\ */
0x1d, //C-]
0x1e, //C-^
0x1f, //C-_
-' ', //
+' ', //
'!', //!
'"', //"
'#', //#
'$', //$
'%', //%
'&', //&
'\'', //'
'(', //(
')', //)
'*', //*
'+', //+
',', //,
'-', //-
'.', //.
'/', ///
0x80, //0
0x81, //1
0x82, //2
0x83, //3
0x84, //4
0x85, //5
0x86, //6
0x87, //7
0x88, //8
@@ -104,49 +104,49 @@ static const char collationHack[] = {
'D', //D
'E', //E
'F', //F
'G', //G
'H', //H
'I', //I
'J', //J
'K', //K
'L', //L
'M', //M
'N', //N
'O', //O
'P', //P
'Q', //Q
'R', //R
'S', //S
'T', //T
'U', //U
'V', //V
'W', //W
'X', //X
'Y', //Y
'Z', //Z
'[', //[
-'\\', //\
+'\\', /* \ */
']', //]
'^', //^
'_', //_
'`', //`
'A', //a
'B', //b
'C', //c
'D', //d
'E', //e
'F', //f
'G', //g
'H', //h
'I', //i
'J', //j
'K', //k
'L', //l
'M', //m
'N', //n
'O', //o
'P', //p
'Q', //q
'R', //r
'S', //s
'T', //t
@@ -168,49 +168,49 @@ static const char collationHack[] = {
0x84, //C-M-D
0x85, //C-M-E
0x86, //C-M-F
0x87, //C-M-G
0x88, //C-M-H
0x89, //C-M-I
0x8a, //C-M-J
0x8b, //C-M-K
0x8c, //C-M-L
0x8d, //C-M-M
0x8e, //C-M-N
0x8f, //C-M-O
0x90, //C-M-P
0x91, //C-M-Q
0x92, //C-M-R
0x93, //C-M-S
0x94, //C-M-T
0x95, //C-M-U
0x96, //C-M-V
0x97, //C-M-W
0x98, //C-M-X
0x99, //C-M-Y
0x9a, //C-M-Z
0x9b, //C-M-[
-0x9c, //C-M-\
+0x9c, /* C-M-\ */
0x9d, //C-M-]
0x9e, //C-M-^
0x9f, //C-M-_
' ', // 
'¡', //¡
'¢', //¢
'£', //£
'¤', //¤
'¥', //¥
'¦', //¦
'§', //§
'¨', //¨
'©', //©
'A', //ª
'«', //«
'¬', //¬
'­', //­
'®', //®
'¯', //¯
'O', //°
'±', //±
'²', //²
'³', //³
'´', //´
@@ -298,67 +298,67 @@ static const char collationHack[] = {
static void hackString ( QString &s )
{
int len = s.length();
const QChar* uc = s.unicode();
for ( int i = 0; i < len; i++ ) {
if ( !uc++->row() )
s[i] = collationHack[s[i].cell()];
}
}
QString buildSortKey( const QString & s )
{
QString res = s;
hackString( res );
return res;
}
QString buildSortKey( const QString & s1, const QString & s2 )
{
QString res = s1 + QChar( '\0' ) + s2;
hackString( res );
return res;
}
-QString buildSortKey( const QString & s1, const QString & s2,
+QString buildSortKey( const QString & s1, const QString & s2,
const QString & s3 )
{
QString res = s1 + QChar( '\0' ) + s2 + QChar( '\0' ) + s3;
hackString( res );
return res;
}
static inline QChar coll( QChar u )
{
return u.row() ? u : QChar(collationHack[ u.cell() ]);
}
int compare( const QString & s1, const QString & s2 )
{
const QChar* u1 = s1.unicode();
const QChar* u2 = s2.unicode();
-
+
if ( u1 == u2 )
return 0;
if ( u1 == 0 )
return 1;
if ( u2 == 0 )
return -1;
int l=QMIN(s1.length(),s2.length());
while ( l-- && coll(*u1) == coll(*u2) )
u1++,u2++;
if ( l==-1 )
return ( s1.length()-s2.length() );
return u1->unicode() - u2->unicode();
}
QString simplifyMultiLineSpace( const QString &multiLine )
{
QString result;
QStringList lines = QStringList::split("\n", multiLine);
for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
if ( it != lines.begin() )
result += "\n";
result += (*it).simplifyWhiteSpace();
}
return result;