Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/corelib/tools/qchar.cpp

    r2 r561  
    22**
    33** 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])
    56**
    67** This file is part of the QtCore module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7171    \brief The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
    7272
    73     \ingroup text
     73    \ingroup
    7474
    7575    This class is only useful to avoid the codec for C strings business
     
    105105    \brief The QChar class provides a 16-bit Unicode character.
    106106
    107     \ingroup text
     107    \ingroup
    108108    \reentrant
    109109
     
    13221322    return in;
    13231323}
    1324 #endif
     1324#endif
    13251325
    13261326/*!
     
    14221422
    14231423
    1424 static QString decomposeHelper
    1425     (const QString &str, bool canonical, QChar::UnicodeVersion version)
     1424static void decomposeHelper(QString *str, bool canonical, QChar::UnicodeVersion version, int from)
    14261425{
    14271426    unsigned short buffer[3];
    14281427
    1429     QString s = str;
    1430 
    1431     const unsigned short *utf16 = s.utf16();
     1428    QString str;
     1429
     1430    const unsigned short *utf16 = );
    14321431    const unsigned short *uc = utf16 + s.length();
    1433     while (uc != utf16) {
     1432    while (uc != utf16) {
    14341433        uint ucs4 = *(--uc);
    14351434        if (QChar(ucs4).isLowSurrogate() && uc != utf16) {
     
    14511450        // since the insert invalidates the pointers and we do decomposition recursive
    14521451        int pos = uc - utf16;
    1453         utf16 = s.utf16();
     1452        utf16 = );
    14541453        uc = utf16 + pos + length;
    14551454    }
    1456 
    1457     return s;
    14581455}
    14591456
     
    14901487}
    14911488
    1492 static QString composeHelper(const QString &str)
    1493 {
    1494     QString s = str;
    1495 
    1496     if (s.length() < 2)
    1497         return s;
     1489static )
     1490{
     1491    QString str;
     1492
     1493    if (s.length() < 2)
     1494        return;
    14981495
    14991496    // the loop can partly ignore high Unicode as all ligatures are in the BMP
    15001497    int starter = 0;
    15011498    int lastCombining = 0;
    1502     int pos = 0;
     1499    int pos = ;
    15031500    while (pos < s.length()) {
    1504         uint uc = s.utf16()[pos];
     1501        uint uc = s.;
    15051502        if (QChar(uc).isHighSurrogate() && pos < s.length()-1) {
    1506             ushort low = s.utf16()[pos+1];
     1503            ushort low = s.;
    15071504            if (QChar(low).isLowSurrogate()) {
    15081505                uc = QChar::surrogateToUcs4(uc, low);
     
    15131510        if (starter == pos - 1 || combining > lastCombining) {
    15141511            // allowed to form ligature with S
    1515             QChar ligature = ligatureHelper(s.utf16()[starter], uc);
     1512            QChar ligature = ligatureHelper(s., uc);
    15161513            if (ligature.unicode()) {
    15171514                s[starter] = ligature;
     
    15251522        ++pos;
    15261523    }
    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
     1527static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, int from)
     1528{
     1529    QString &s = *str;
    15351530    const int l = s.length()-1;
    1536     int pos = 0;
     1531    int pos = ;
    15371532    while (pos < l) {
    15381533        int p2 = pos+1;
     
    15941589        }
    15951590    }
    1596     return s;
    15971591}
    15981592
Note: See TracChangeset for help on using the changeset viewer.