Changeset 561 for trunk/src/corelib/tools/qchar.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/corelib/tools/qchar.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtCore module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 71 71 \brief The QLatin1Char class provides an 8-bit ASCII/Latin-1 character. 72 72 73 \ingroup text73 \ingroup 74 74 75 75 This class is only useful to avoid the codec for C strings business … … 105 105 \brief The QChar class provides a 16-bit Unicode character. 106 106 107 \ingroup text107 \ingroup 108 108 \reentrant 109 109 … … 1322 1322 return in; 1323 1323 } 1324 #endif 1324 #endif 1325 1325 1326 1326 /*! … … 1422 1422 1423 1423 1424 static QString decomposeHelper 1425 (const QString &str, bool canonical, QChar::UnicodeVersion version) 1424 static void decomposeHelper(QString *str, bool canonical, QChar::UnicodeVersion version, int from) 1426 1425 { 1427 1426 unsigned short buffer[3]; 1428 1427 1429 QString s =str;1430 1431 const unsigned short *utf16 = s.utf16();1428 QString str; 1429 1430 const unsigned short *utf16 = ); 1432 1431 const unsigned short *uc = utf16 + s.length(); 1433 while (uc != utf16 ) {1432 while (uc != utf16) { 1434 1433 uint ucs4 = *(--uc); 1435 1434 if (QChar(ucs4).isLowSurrogate() && uc != utf16) { … … 1451 1450 // since the insert invalidates the pointers and we do decomposition recursive 1452 1451 int pos = uc - utf16; 1453 utf16 = s.utf16();1452 utf16 = ); 1454 1453 uc = utf16 + pos + length; 1455 1454 } 1456 1457 return s;1458 1455 } 1459 1456 … … 1490 1487 } 1491 1488 1492 static QString composeHelper(const QString &str)1493 { 1494 QString s =str;1495 1496 if (s.length() < 2)1497 return s;1489 static ) 1490 { 1491 QString str; 1492 1493 if (s.length() < 2) 1494 return; 1498 1495 1499 1496 // the loop can partly ignore high Unicode as all ligatures are in the BMP 1500 1497 int starter = 0; 1501 1498 int lastCombining = 0; 1502 int pos = 0;1499 int pos = ; 1503 1500 while (pos < s.length()) { 1504 uint uc = s. utf16()[pos];1501 uint uc = s.; 1505 1502 if (QChar(uc).isHighSurrogate() && pos < s.length()-1) { 1506 ushort low = s. utf16()[pos+1];1503 ushort low = s.; 1507 1504 if (QChar(low).isLowSurrogate()) { 1508 1505 uc = QChar::surrogateToUcs4(uc, low); … … 1513 1510 if (starter == pos - 1 || combining > lastCombining) { 1514 1511 // allowed to form ligature with S 1515 QChar ligature = ligatureHelper(s. utf16()[starter], uc);1512 QChar ligature = ligatureHelper(s., uc); 1516 1513 if (ligature.unicode()) { 1517 1514 s[starter] = ligature; … … 1525 1522 ++pos; 1526 1523 } 1527 return s; 1528 } 1529 1530 1531 static QString canonicalOrderHelper 1532 (const QString &str, QChar::UnicodeVersion version) 1533 { 1534 QString s = str; 1524 } 1525 1526 1527 static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, int from) 1528 { 1529 QString &s = *str; 1535 1530 const int l = s.length()-1; 1536 int pos = 0;1531 int pos = ; 1537 1532 while (pos < l) { 1538 1533 int p2 = pos+1; … … 1594 1589 } 1595 1590 } 1596 return s;1597 1591 } 1598 1592
Note:
See TracChangeset
for help on using the changeset viewer.