Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/corelib/tools/qbytedata_p.h

    r651 r769  
    8585
    8686
    87     inline void append(QByteArray& bd)
     87    inline void append(QByteArray& bd)
    8888    {
    8989        if (bd.isEmpty())
  • trunk/src/corelib/tools/qchar.cpp

    r651 r769  
    382382    \value Null A QChar with this value isNull().
    383383    \value Nbsp Non-breaking space.
    384     \value ReplacementCharacter
    385     \value ObjectReplacementCharacter The character shown when a font has no glyph for a certain codepoint. The square character is normally used.
     384    \value ReplacementCharacter The character shown when a font has no glyph
     385           for a certain codepoint. A special question mark character is often
     386           used. Codecs use this codepoint when input data cannot be
     387           represented in Unicode.
     388    \value ObjectReplacementCharacter Used to represent an object such as an
     389           image when such objects cannot be presented.
    386390    \value ByteOrderMark
    387391    \value ByteOrderSwapped
  • trunk/src/corelib/tools/qcontiguouscache.h

    r651 r769  
    9898    typedef value_type& reference;
    9999    typedef const value_type& const_reference;
    100     typedef ptrdiff_t difference_type;
     100    typedef difference_type;
    101101    typedef int size_type;
    102102
     
    222222    x.d->count = qMin(d->count, asize);
    223223    x.d->offset = d->offset + d->count - x.d->count;
    224     x.d->start = x.d->offset % x.d->alloc;
    225     T *dest = x.p->array + (x.d->start + x.d->count-1) % x.d->alloc;
    226     T *src = p->array + (d->start + d->count-1) % d->alloc;
     224    if(asize)
     225        x.d->start = x.d->offset % x.d->alloc;
     226    else
     227        x.d->start = 0;
     228
    227229    int oldcount = x.d->count;
    228     while (oldcount--) {
    229         if (QTypeInfo<T>::isComplex) {
    230             new (dest) T(*src);
    231         } else {
    232             *dest = *src;
     230    if(oldcount)
     231    {
     232        T *dest = x.p->array + (x.d->start + x.d->count-1) % x.d->alloc;
     233        T *src = p->array + (d->start + d->count-1) % d->alloc;
     234        while (oldcount--) {
     235            if (QTypeInfo<T>::isComplex) {
     236                new (dest) T(*src);
     237            } else {
     238                *dest = *src;
     239            }
     240            if (dest == x.p->array)
     241                dest = x.p->array + x.d->alloc;
     242            dest--;
     243            if (src == p->array)
     244                src = p->array + d->alloc;
     245            src--;
    233246        }
    234         if (dest == x.p->array)
    235             dest = x.p->array + x.d->alloc;
    236         dest--;
    237         if (src == p->array)
    238             src = p->array + d->alloc;
    239         src--;
    240247    }
    241248    /* free old */
  • trunk/src/corelib/tools/qhash.cpp

    r651 r769  
    6969    while (n--) {
    7070        h = (h << 4) + *p++;
    71         if ((g = (h & 0xf0000000)) != 0)
    72             h ^= g >> 23;
     71       
     72        h ^= g >> 23;
    7373        h &= ~g;
    7474    }
     
    8383    while (n--) {
    8484        h = (h << 4) + (*p++).unicode();
    85         if ((g = (h & 0xf0000000)) != 0)
    86             h ^= g >> 23;
     85       
     86        h ^= g >> 23;
    8787        h &= ~g;
    8888    }
  • trunk/src/corelib/tools/qhash.h

    r651 r769  
    330330    public:
    331331        typedef std::bidirectional_iterator_tag iterator_category;
    332         typedef ptrdiff_t difference_type;
     332        typedef difference_type;
    333333        typedef T value_type;
    334334        typedef T *pointer;
     
    395395    public:
    396396        typedef std::bidirectional_iterator_tag iterator_category;
    397         typedef ptrdiff_t difference_type;
     397        typedef difference_type;
    398398        typedef T value_type;
    399399        typedef const T *pointer;
     
    479479    typedef T mapped_type;
    480480    typedef Key key_type;
    481     typedef ptrdiff_t difference_type;
     481    typedef difference_type;
    482482    typedef int size_type;
    483483
     
    928928
    929929    inline QMultiHash &operator+=(const QMultiHash &other)
    930     { unite(other); return *this; }
     930    { unite(other); return *this; }
    931931    inline QMultiHash operator+(const QMultiHash &other) const
    932932    { QMultiHash result = *this; result += other; return result; }
     
    10031003    while (i != end && i.key() == key) {
    10041004        if (i.value() == value) {
    1005 #if defined(Q_CC_RVCT)
    1006             // RVCT has problems with scoping, apparently.
    1007             i = QHash<Key, T>::erase(i);
    1008 #else
    1009             i = erase(i);
    1010 #endif
     1005            i = this->erase(i);
    10111006            ++n;
    10121007        } else {
  • trunk/src/corelib/tools/qlinkedlist.h

    r651 r769  
    114114    public:
    115115        typedef std::bidirectional_iterator_tag  iterator_category;
    116         typedef ptrdiff_t difference_type;
     116        typedef difference_type;
    117117        typedef T value_type;
    118118        typedef T *pointer;
     
    147147    public:
    148148        typedef std::bidirectional_iterator_tag  iterator_category;
    149         typedef ptrdiff_t difference_type;
     149        typedef difference_type;
    150150        typedef T value_type;
    151151        typedef const T *pointer;
     
    213213    typedef value_type &reference;
    214214    typedef const value_type &const_reference;
    215     typedef ptrdiff_t difference_type;
     215    typedef difference_type;
    216216
    217217#ifndef QT_NO_STL
  • trunk/src/corelib/tools/qlist.cpp

    r651 r769  
    209209    if (n) {
    210210        if (e + n > d->alloc)
    211             realloc(grow(e + l.d->end - l.d->begin));
     211            realloc(grow(e + n));
    212212        d->end += n;
    213213    }
  • trunk/src/corelib/tools/qlist.h

    r651 r769  
    164164        Node *i;
    165165        typedef std::random_access_iterator_tag  iterator_category;
    166         typedef ptrdiff_t difference_type;
     166        typedef difference_type;
    167167        typedef T value_type;
    168168        typedef T *pointer;
     
    211211        Node *i;
    212212        typedef std::random_access_iterator_tag  iterator_category;
    213         typedef ptrdiff_t difference_type;
     213        typedef difference_type;
    214214        typedef T value_type;
    215215        typedef const T *pointer;
     
    290290    typedef value_type &reference;
    291291    typedef const value_type &const_reference;
    292     typedef ptrdiff_t difference_type;
     292    typedef difference_type;
    293293
    294294#ifdef QT3_SUPPORT
  • trunk/src/corelib/tools/qlocale.cpp

    r717 r769  
    774774};
    775775
     776
    776777static const WindowsToISOListElt windows_to_iso_list[] = {
    777778    { 0x0401, "ar_SA" },
  • trunk/src/corelib/tools/qlocale_symbian.cpp

    r651 r769  
    8888
    8989/*
    90   Mapping from Symbian to ISO locale
     90  Mapping from Symbian to ISO locale.
     91  NOTE: This array should be sorted by the first column!
    9192*/
    9293static const symbianToISO symbian_to_iso_list[] = {
    93     { ELangEnglish,             "en_GB" },
    94     { ELangFrench,              "fr_FR" },
    95     { ELangGerman,              "de_DE" },
    96     { ELangSpanish,             "es_ES" },
    97     { ELangItalian,             "it_IT" },
    98     { ELangSwedish,             "sv_SE" },
    99     { ELangDanish,              "da_DK" },
    100     { ELangNorwegian,           "no_NO" },
    101     { ELangFinnish,             "fi_FI" },
    102     { ELangAmerican,            "en_US" },
    103     { ELangPortuguese,          "pt_PT" },
    104     { ELangTurkish,             "tr_TR" },
    105     { ELangIcelandic,           "is_IS" },
    106     { ELangRussian,             "ru_RU" },
    107     { ELangHungarian,           "hu_HU" },
    108     { ELangDutch,               "nl_NL" },
    109     { ELangBelgianFlemish,      "nl_BE" },
    110     { ELangCzech,               "cs_CZ" },
    111     { ELangSlovak,              "sk_SK" },
    112     { ELangPolish,              "pl_PL" },
    113     { ELangSlovenian,           "sl_SI" },
    114     { ELangTaiwanChinese,       "zh_TW" },
    115     { ELangHongKongChinese,     "zh_HK" },
    116     { ELangPrcChinese,          "zh_CN" },
    117     { ELangJapanese,            "ja_JP" },
    118     { ELangThai,                "th_TH" },
    119     { ELangArabic,              "ar_AE" },
    120     { ELangTagalog,             "tl_PH" },
    121     { ELangBulgarian,           "bg_BG" },
    122     { ELangCatalan,             "ca_ES" },
    123     { ELangCroatian,            "hr_HR" },
    124     { ELangEstonian,            "et_EE" },
    125     { ELangFarsi,               "fa_IR" },
    126     { ELangCanadianFrench,      "fr_CA" },
    127     { ELangGreek,               "el_GR" },
    128     { ELangHebrew,              "he_IL" },
    129     { ELangHindi,               "hi_IN" },
    130     { ELangIndonesian,          "id_ID" },
    131     { ELangLatvian,             "lv_LV" },
    132     { ELangLithuanian,          "lt_LT" },
    133     { ELangMalay,               "ms_MY" },
    134     { ELangBrazilianPortuguese, "pt_BR" },
    135     { ELangRomanian,            "ro_RO" },
    136     { ELangSerbian,             "sr_YU" },
    137     { ELangLatinAmericanSpanish, "es" },
    138     { ELangUkrainian,           "uk_UA" },
    139     { ELangUrdu,                "ur_PK" }, // India/Pakistan
    140     { ELangVietnamese,          "vi_VN" },
     94    { ELangEnglish,             "en_GB" },  // 1
     95    { ELangFrench,              "fr_FR" },  // 2
     96    { ELangGerman,              "de_DE" },  // 3
     97    { ELangSpanish,             "es_ES" },  // 4
     98    { ELangItalian,             "it_IT" },  // 5
     99    { ELangSwedish,             "sv_SE" },  // 6
     100    { ELangDanish,              "da_DK" },  // 7
     101    { ELangNorwegian,           "no_NO" },  // 8
     102    { ELangFinnish,             "fi_FI" },  // 9
     103    { ELangAmerican,            "en_US" },  // 10
     104    { ELangPortuguese,          "pt_PT" },  // 13
     105    { ELangTurkish,             "tr_TR" },  // 14
     106    { ELangIcelandic,           "is_IS" },  // 15
     107    { ELangRussian,             "ru_RU" },  // 16
     108    { ELangHungarian,           "hu_HU" },  // 17
     109    { ELangDutch,               "nl_NL" },  // 18
     110    { ELangBelgianFlemish,      "nl_BE" },  // 19
     111    { ELangCzech,               "cs_CZ" },  // 25
     112    { ELangSlovak,              "sk_SK" },  // 26
     113    { ELangPolish,              "pl_PL" },  // 27
     114    { ELangSlovenian,           "sl_SI" },  // 28
     115    { ELangTaiwanChinese,       "zh_TW" },  // 29
     116    { ELangHongKongChinese,     "zh_HK" },  // 30
     117    { ELangPrcChinese,          "zh_CN" },  // 31
     118    { ELangJapanese,            "ja_JP" },  // 32
     119    { ELangThai,                "th_TH" },  // 33
     120    { ELangArabic,              "ar_AE" },  // 37
     121    { ELangTagalog,             "tl_PH" },  // 39
     122    { ELangBulgarian,           "bg_BG" },  // 42
     123    { ELangCatalan,             "ca_ES" },  // 44
     124    { ELangCroatian,            "hr_HR" },  // 45
     125    { ELangEstonian,            "et_EE" },  // 49
     126    { ELangFarsi,               "fa_IR" },  // 50
     127    { ELangCanadianFrench,      "fr_CA" },  // 51
     128    { ELangGreek,               "el_GR" },  // 54
     129    { ELangHebrew,              "he_IL" },  // 57
     130    { ELangHindi,               "hi_IN" },  // 58
     131    { ELangIndonesian,          "id_ID" },  // 59
     132    { ELangKorean,              "ko_KO" },  // 65
     133    { ELangLatvian,             "lv_LV" },  // 67
     134    { ELangLithuanian,          "lt_LT" },  // 68
     135    { ELangMalay,               "ms_MY" },  // 70
     136    { ELangNorwegianNynorsk,    "nn_NO" },  // 75
     137    { ELangBrazilianPortuguese, "pt_BR" },  // 76
     138    { ELangRomanian,            "ro_RO" },  // 78
     139    { ELangSerbian,             "sr_RS" },  // 79
     140    { ELangLatinAmericanSpanish,"es_419" }, // 83
     141    { ELangUkrainian,           "uk_UA" },  // 93
     142    { ELangUrdu,                "ur_PK" },  // 94 - India/Pakistan
     143    { ELangVietnamese,          "vi_VN" },  // 96
    141144#ifdef __E32LANG_H__
    142145// 5.0
    143     { ELangBasque,              "eu_ES" },
    144     { ELangGalician,            "gl_ES" },
     146    { ELangBasque,              "eu_ES" },
     147    { ELangGalician,            "gl_ES" },
    145148#endif
    146149#if !defined(__SERIES60_31__)
    147     { ELangEnglish_Apac,        "en" },
    148     { ELangEnglish_Taiwan,      "en_TW" },
    149     { ELangEnglish_HongKong,    "en_HK" },
    150     { ELangEnglish_Prc,         "en_CN" },
    151     { ELangEnglish_Japan,       "en_JP"},
    152     { ELangEnglish_Thailand,    "en_TH" },
    153     { ELangMalay_Apac,          "ms" }
     150    { ELangEnglish_Apac,        "en" },
     151    { ELangEnglish_Taiwan,      "en_TW" },
     152    { ELangEnglish_HongKong,    "en_HK" },
     153    { ELangEnglish_Prc,         "en_CN" },
     154    { ELangEnglish_Japan,       "en_JP"},
     155    { ELangEnglish_Thailand,    "en_TH" },
     156    { ELangMalay_Apac,          "ms" }
    154157#endif
     158
    155159};
    156160
  • trunk/src/corelib/tools/qmap.h

    r651 r769  
    214214    public:
    215215        typedef std::bidirectional_iterator_tag iterator_category;
    216         typedef ptrdiff_t difference_type;
     216        typedef difference_type;
    217217        typedef T value_type;
    218218        typedef T *pointer;
     
    282282    public:
    283283        typedef std::bidirectional_iterator_tag iterator_category;
    284         typedef ptrdiff_t difference_type;
     284        typedef difference_type;
    285285        typedef T value_type;
    286286        typedef const T *pointer;
     
    385385    typedef Key key_type;
    386386    typedef T mapped_type;
    387     typedef ptrdiff_t difference_type;
     387    typedef difference_type;
    388388    typedef int size_type;
    389389    inline bool empty() const { return isEmpty(); }
     
    954954
    955955    inline QMultiMap &operator+=(const QMultiMap &other)
    956     { unite(other); return *this; }
     956    { unite(other); return *this; }
    957957    inline QMultiMap operator+(const QMultiMap &other) const
    958958    { QMultiMap result = *this; result += other; return result; }
     
    10291029    while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
    10301030        if (i.value() == value) {
    1031 #if defined(Q_CC_RVCT)
    1032             // RVCT has problems with scoping, apparently.
    1033             i = QMap<Key, T>::erase(i);
    1034 #else
    1035             i = erase(i);
    1036 #endif
     1031            i = this->erase(i);
    10371032            ++n;
    10381033        } else {
  • trunk/src/corelib/tools/qpoint.cpp

    r651 r769  
    375375{
    376376    d.nospace() << "QPointF(" << p.x() << ", " << p.y() << ')';
    377     return d;
     377    return d;
    378378}
    379379#endif
  • trunk/src/corelib/tools/qregexp.cpp

    r651 r769  
    524524
    525525    In the mode Wildcard, the wildcard characters cannot be
    526     escaped. In the mode WildcardUnix, the character '\' escapes the
     526    escaped. In the mode WildcardUnix, the character '\' escapes the
    527527    wildcard.
    528528
     
    37753775    \value WildcardUnix This is similar to Wildcard but with the
    37763776    behavior of a Unix shell. The wildcard characters can be escaped
    3777     with the character "\".
     3777    with the character "\".
    37783778
    37793779    \value FixedString The pattern is a fixed string. This is
  • trunk/src/corelib/tools/qscopedpointer.cpp

    r651 r769  
    5858
    5959    QScopedPointer guarantees that the object pointed to will get deleted when
    60     the current scope dissapears.
     60    the current scope dispears.
    6161
    6262    Consider this function which does heap allocations, and have various exit points:
     
    226226 */
    227227
     228
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
     282
    228283QT_END_NAMESPACE
  • trunk/src/corelib/tools/qset.h

    r651 r769  
    9898    public:
    9999        typedef std::bidirectional_iterator_tag iterator_category;
    100         typedef ptrdiff_t difference_type;
     100        typedef difference_type;
    101101        typedef T value_type;
    102102        typedef const T *pointer;
     
    133133    public:
    134134        typedef std::bidirectional_iterator_tag iterator_category;
    135         typedef ptrdiff_t difference_type;
     135        typedef difference_type;
    136136        typedef T value_type;
    137137        typedef const T *pointer;
     
    189189    typedef value_type &reference;
    190190    typedef const value_type &const_reference;
    191     typedef ptrdiff_t difference_type;
     191    typedef difference_type;
    192192    typedef int size_type;
    193193
    194194    inline bool empty() const { return isEmpty(); }
    195 
    196195    // comfort
    197196    inline QSet<T> &operator<<(const T &value) { insert(value); return *this; }
  • trunk/src/corelib/tools/qsharedpointer_impl.h

    r651 r769  
    133133        typedef value_type &reference;
    134134        typedef const value_type &const_reference;
    135         typedef ptrdiff_t difference_type;
     135        typedef difference_type;
    136136
    137137        inline T *data() const { return value; }
     
    542542    typedef value_type &reference;
    543543    typedef const value_type &const_reference;
    544     typedef ptrdiff_t difference_type;
     544    typedef difference_type;
    545545
    546546    inline bool isNull() const { return d == 0 || d->strongref == 0 || value == 0; }
  • trunk/src/corelib/tools/qstring.cpp

    r659 r769  
    891891{
    892892    if (sizeof(wchar_t) == sizeof(QChar)) {
    893         return fromUtf16((ushort *)string, size);
     893        return fromUtf16((ushort *)string, size);
    894894    } else {
    895895        return fromUcs4((uint *)string, size);
     
    31913191            x++;
    31923192    }
    3193     if((flags & SectionIncludeLeadingSep)) {
     3193    if((flags & SectionIncludeLeadingSep)) {
    31943194        const qt_section_chunk &section = sections.at(first_i);
    31953195        ret.prepend(section.string.left(section.length));
     
    38633863    with a 0.
    38643864
     3865
     3866
     3867
     3868
     3869
     3870
    38653871    QString makes a deep copy of the Unicode data.
    38663872
     
    39283934    If \a unicode is 0, nothing is copied, but the string is still
    39293935    resized to \a size.
     3936
     3937
     3938
    39303939
    39313940    \sa utf16(), setUnicode()
     
    47054714    Returns the QString as a '\\0\'-terminated array of unsigned
    47064715    shorts. The result remains valid until the string is modified.
     4716
     4717
    47074718
    47084719    \sa unicode()
     
    77777788    if (m_size && m_position == 0 && m_size == m_string->size())
    77787789        return *m_string;
    7779     return QString::fromUtf16(reinterpret_cast<const ushort*>(m_string->unicode() + m_position), m_size);
     7790    return QString, m_size);
    77807791}
    77817792
  • trunk/src/corelib/tools/qstringbuilder.h

    r651 r769  
    7272private:
    7373    const int m_size;
    74     const char *m_data;
     74    const char *m_data;
    7575};
    7676
  • trunk/src/corelib/tools/qstringlist.cpp

    r651 r769  
    405405QString QtPrivate::QStringList_join(const QStringList *that, const QString &sep)
    406406{
    407     int totalLength = 0;
    408     const int size = that->size();
    409 
    410     for (int i = 0; i < size; ++i)
    411         totalLength += that->at(i).size();
    412 
    413     if(size > 0)
    414         totalLength += sep.size() * (size - 1);
    415 
    416407    QString res;
    417     res.reserve(totalLength);
    418408    for (int i = 0; i < that->size(); ++i) {
    419409        if (i)
  • trunk/src/corelib/tools/qvarlengtharray.h

    r651 r769  
    129129    void realloc(int size, int alloc);
    130130
    131     int a;
    132     int s;
    133     T *ptr;
     131    int a;
     132    int s;
     133    T *ptr;
    134134    union {
    135135        // ### Qt 5: Use 'Prealloc * sizeof(T)' as array size
     
    194194    T *oldPtr = ptr;
    195195    int osize = s;
    196     // s = asize;
    197 
     196
     197    const int copySize = qMin(asize, osize);
    198198    if (aalloc != a) {
    199199        ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T)));
     
    206206                QT_TRY {
    207207                    // copy all the old elements
    208                     const int copySize = qMin(asize, osize);
    209208                    while (s < copySize) {
    210209                        new (ptr+s) T(*(oldPtr+s));
     
    222221                }
    223222            } else {
    224                 qMemCopy(ptr, oldPtr, qMin(asize, osize) * sizeof(T));
    225                 s = asize;
     223                qMemCopy(ptr, oldPtr, copySize * sizeof(T));
    226224            }
    227225        } else {
     
    230228        }
    231229    }
    232 
    233     if (QTypeInfo<T>::isComplex) {
     230    s = copySize;
     231
     232    if (QTypeInfo<T>::isComplex) {
     233        // destroy remaining old objects
    234234        while (osize > asize)
    235235            (oldPtr+(--osize))->~T();
    236         if( oldPtr == ptr )
    237             s = osize;
    238236    }
    239237
  • trunk/src/corelib/tools/qvector.h

    r651 r769  
    164164        T *i;
    165165        typedef std::random_access_iterator_tag  iterator_category;
    166         typedef ptrdiff_t difference_type;
     166        typedef difference_type;
    167167        typedef T value_type;
    168168        typedef T *pointer;
     
    197197        T *i;
    198198        typedef std::random_access_iterator_tag  iterator_category;
    199         typedef ptrdiff_t difference_type;
     199        typedef difference_type;
    200200        typedef T value_type;
    201201        typedef const T *pointer;
     
    261261    typedef value_type& reference;
    262262    typedef const value_type& const_reference;
    263     typedef ptrdiff_t difference_type;
     263    typedef difference_type;
    264264    typedef iterator Iterator;
    265265    typedef const_iterator ConstIterator;
Note: See TracChangeset for help on using the changeset viewer.