summaryrefslogtreecommitdiff
authorzecke <zecke>2004-09-10 11:09:28 (UTC)
committer zecke <zecke>2004-09-10 11:09:28 (UTC)
commite64d9e9682e0afefc4fbebe7ba9737e0f86e3ed7 (patch) (unidiff)
treeb3a931b24a7ad2f22ae8c774b0fc2e9eb69c0934
parentd7743f52d37979b3a3f95e8e85fdaad742e1f3c1 (diff)
downloadopie-e64d9e9682e0afefc4fbebe7ba9737e0f86e3ed7.zip
opie-e64d9e9682e0afefc4fbebe7ba9737e0f86e3ed7.tar.gz
opie-e64d9e9682e0afefc4fbebe7ba9737e0f86e3ed7.tar.bz2
Fix warnings of '//' inside the comment
Diffstat (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[] = {
400x04, //C-D 400x04, //C-D
410x05, //C-E 410x05, //C-E
420x06, //C-F 420x06, //C-F
430x07, //C-G 430x07, //C-G
440x08, //C-H 440x08, //C-H
450x09, //C-I 450x09, //C-I
460x0a, //C-J 460x0a, //C-J
470x0b, //C-K 470x0b, //C-K
480x0c, //C-L 480x0c, //C-L
490x0d, //C-M 490x0d, //C-M
500x0e, //C-N 500x0e, //C-N
510x0f, //C-O 510x0f, //C-O
520x10, //C-P 520x10, //C-P
530x11, //C-Q 530x11, //C-Q
540x12, //C-R 540x12, //C-R
550x13, //C-S 550x13, //C-S
560x14, //C-T 560x14, //C-T
570x15, //C-U 570x15, //C-U
580x16, //C-V 580x16, //C-V
590x17, //C-W 590x17, //C-W
600x18, //C-X 600x18, //C-X
610x19, //C-Y 610x19, //C-Y
620x1a, //C-Z 620x1a, //C-Z
630x1b, //C-[ 630x1b, //C-[
640x1c, //C-\ 640x1c, /* C-\ */
650x1d, //C-] 650x1d, //C-]
660x1e, //C-^ 660x1e, //C-^
670x1f, //C-_ 670x1f, //C-_
68' ', // 68' ', //
69'!', //! 69'!', //!
70'"', //" 70'"', //"
71'#', //# 71'#', //#
72'$', //$ 72'$', //$
73'%', //% 73'%', //%
74'&', //& 74'&', //&
75'\'', //' 75'\'', //'
76'(', //( 76'(', //(
77')', //) 77')', //)
78'*', //* 78'*', //*
79'+', //+ 79'+', //+
80',', //, 80',', //,
81'-', //- 81'-', //-
82'.', //. 82'.', //.
83'/', /// 83'/', ///
840x80, //0 840x80, //0
850x81, //1 850x81, //1
860x82, //2 860x82, //2
870x83, //3 870x83, //3
880x84, //4 880x84, //4
890x85, //5 890x85, //5
900x86, //6 900x86, //6
910x87, //7 910x87, //7
920x88, //8 920x88, //8
@@ -104,49 +104,49 @@ static const char collationHack[] = {
104'D', //D 104'D', //D
105'E', //E 105'E', //E
106'F', //F 106'F', //F
107'G', //G 107'G', //G
108'H', //H 108'H', //H
109'I', //I 109'I', //I
110'J', //J 110'J', //J
111'K', //K 111'K', //K
112'L', //L 112'L', //L
113'M', //M 113'M', //M
114'N', //N 114'N', //N
115'O', //O 115'O', //O
116'P', //P 116'P', //P
117'Q', //Q 117'Q', //Q
118'R', //R 118'R', //R
119'S', //S 119'S', //S
120'T', //T 120'T', //T
121'U', //U 121'U', //U
122'V', //V 122'V', //V
123'W', //W 123'W', //W
124'X', //X 124'X', //X
125'Y', //Y 125'Y', //Y
126'Z', //Z 126'Z', //Z
127'[', //[ 127'[', //[
128'\\', //\ 128'\\', /* \ */
129']', //] 129']', //]
130'^', //^ 130'^', //^
131'_', //_ 131'_', //_
132'`', //` 132'`', //`
133'A', //a 133'A', //a
134'B', //b 134'B', //b
135'C', //c 135'C', //c
136'D', //d 136'D', //d
137'E', //e 137'E', //e
138'F', //f 138'F', //f
139'G', //g 139'G', //g
140'H', //h 140'H', //h
141'I', //i 141'I', //i
142'J', //j 142'J', //j
143'K', //k 143'K', //k
144'L', //l 144'L', //l
145'M', //m 145'M', //m
146'N', //n 146'N', //n
147'O', //o 147'O', //o
148'P', //p 148'P', //p
149'Q', //q 149'Q', //q
150'R', //r 150'R', //r
151'S', //s 151'S', //s
152'T', //t 152'T', //t
@@ -168,49 +168,49 @@ static const char collationHack[] = {
1680x84, //C-M-D 1680x84, //C-M-D
1690x85, //C-M-E 1690x85, //C-M-E
1700x86, //C-M-F 1700x86, //C-M-F
1710x87, //C-M-G 1710x87, //C-M-G
1720x88, //C-M-H 1720x88, //C-M-H
1730x89, //C-M-I 1730x89, //C-M-I
1740x8a, //C-M-J 1740x8a, //C-M-J
1750x8b, //C-M-K 1750x8b, //C-M-K
1760x8c, //C-M-L 1760x8c, //C-M-L
1770x8d, //C-M-M 1770x8d, //C-M-M
1780x8e, //C-M-N 1780x8e, //C-M-N
1790x8f, //C-M-O 1790x8f, //C-M-O
1800x90, //C-M-P 1800x90, //C-M-P
1810x91, //C-M-Q 1810x91, //C-M-Q
1820x92, //C-M-R 1820x92, //C-M-R
1830x93, //C-M-S 1830x93, //C-M-S
1840x94, //C-M-T 1840x94, //C-M-T
1850x95, //C-M-U 1850x95, //C-M-U
1860x96, //C-M-V 1860x96, //C-M-V
1870x97, //C-M-W 1870x97, //C-M-W
1880x98, //C-M-X 1880x98, //C-M-X
1890x99, //C-M-Y 1890x99, //C-M-Y
1900x9a, //C-M-Z 1900x9a, //C-M-Z
1910x9b, //C-M-[ 1910x9b, //C-M-[
1920x9c, //C-M-\ 1920x9c, /* C-M-\ */
1930x9d, //C-M-] 1930x9d, //C-M-]
1940x9e, //C-M-^ 1940x9e, //C-M-^
1950x9f, //C-M-_ 1950x9f, //C-M-_
196' ', //  196' ', // 
197'¡', //¡ 197'¡', //¡
198'¢', //¢ 198'¢', //¢
199'£', //£ 199'£', //£
200'¤', //¤ 200'¤', //¤
201'¥', //¥ 201'¥', //¥
202'¦', //¦ 202'¦', //¦
203'§', //§ 203'§', //§
204'¨', //¨ 204'¨', //¨
205'©', //© 205'©', //©
206'A', //ª 206'A', //ª
207'«', //« 207'«', //«
208'¬', //¬ 208'¬', //¬
209'­', //­ 209'­', //­
210'®', //® 210'®', //®
211'¯', //¯ 211'¯', //¯
212'O', //° 212'O', //°
213'±', //± 213'±', //±
214'²', //² 214'²', //²
215'³', //³ 215'³', //³
216'´', //´ 216'´', //´
@@ -298,67 +298,67 @@ static const char collationHack[] = {
298static void hackString ( QString &s ) 298static void hackString ( QString &s )
299{ 299{
300 int len = s.length(); 300 int len = s.length();
301 const QChar* uc = s.unicode(); 301 const QChar* uc = s.unicode();
302 for ( int i = 0; i < len; i++ ) { 302 for ( int i = 0; i < len; i++ ) {
303 if ( !uc++->row() ) 303 if ( !uc++->row() )
304 s[i] = collationHack[s[i].cell()]; 304 s[i] = collationHack[s[i].cell()];
305 } 305 }
306} 306}
307 307
308QString buildSortKey( const QString & s ) 308QString buildSortKey( const QString & s )
309{ 309{
310 QString res = s; 310 QString res = s;
311 hackString( res ); 311 hackString( res );
312 return res; 312 return res;
313} 313}
314 314
315QString buildSortKey( const QString & s1, const QString & s2 ) 315QString buildSortKey( const QString & s1, const QString & s2 )
316{ 316{
317 QString res = s1 + QChar( '\0' ) + s2; 317 QString res = s1 + QChar( '\0' ) + s2;
318 hackString( res ); 318 hackString( res );
319 return res; 319 return res;
320} 320}
321 321
322QString buildSortKey( const QString & s1, const QString & s2, 322QString buildSortKey( const QString & s1, const QString & s2,
323 const QString & s3 ) 323 const QString & s3 )
324{ 324{
325 QString res = s1 + QChar( '\0' ) + s2 + QChar( '\0' ) + s3; 325 QString res = s1 + QChar( '\0' ) + s2 + QChar( '\0' ) + s3;
326 hackString( res ); 326 hackString( res );
327 return res; 327 return res;
328} 328}
329 329
330static inline QChar coll( QChar u ) 330static inline QChar coll( QChar u )
331{ 331{
332 return u.row() ? u : QChar(collationHack[ u.cell() ]); 332 return u.row() ? u : QChar(collationHack[ u.cell() ]);
333} 333}
334 334
335 335
336int compare( const QString & s1, const QString & s2 ) 336int compare( const QString & s1, const QString & s2 )
337{ 337{
338 const QChar* u1 = s1.unicode(); 338 const QChar* u1 = s1.unicode();
339 const QChar* u2 = s2.unicode(); 339 const QChar* u2 = s2.unicode();
340 340
341 if ( u1 == u2 ) 341 if ( u1 == u2 )
342 return 0; 342 return 0;
343 if ( u1 == 0 ) 343 if ( u1 == 0 )
344 return 1; 344 return 1;
345 if ( u2 == 0 ) 345 if ( u2 == 0 )
346 return -1; 346 return -1;
347 int l=QMIN(s1.length(),s2.length()); 347 int l=QMIN(s1.length(),s2.length());
348 while ( l-- && coll(*u1) == coll(*u2) ) 348 while ( l-- && coll(*u1) == coll(*u2) )
349 u1++,u2++; 349 u1++,u2++;
350 if ( l==-1 ) 350 if ( l==-1 )
351 return ( s1.length()-s2.length() ); 351 return ( s1.length()-s2.length() );
352 return u1->unicode() - u2->unicode(); 352 return u1->unicode() - u2->unicode();
353} 353}
354 354
355QString simplifyMultiLineSpace( const QString &multiLine ) 355QString simplifyMultiLineSpace( const QString &multiLine )
356{ 356{
357 QString result; 357 QString result;
358 QStringList lines = QStringList::split("\n", multiLine); 358 QStringList lines = QStringList::split("\n", multiLine);
359 for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) { 359 for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
360 if ( it != lines.begin() ) 360 if ( it != lines.begin() )
361 result += "\n"; 361 result += "\n";
362 result += (*it).simplifyWhiteSpace(); 362 result += (*it).simplifyWhiteSpace();
363 } 363 }
364 return result; 364 return result;