Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/text/qfontdatabase.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    149149struct QtFontSize
    150150{
    151     unsigned short pixelSize;
    152 
    153151#ifdef Q_WS_X11
    154     int count;
    155152    QtFontEncoding *encodings;
    156153    QtFontEncoding *encodingID(int id, uint xpoint = 0, uint xres = 0,
    157154                                uint yres = 0, uint avgwidth = 0, bool add = false);
     155
    158156#endif // Q_WS_X11
    159157#ifdef Q_WS_PM
     
    164162    int fileIndex;
    165163#endif // defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
     164
     165
    166166};
    167167
     
    294294        return 0;
    295295
    296     if (!(count % 8)) {
     296    if (!pixelSizes) {
     297        // Most style have only one font size, we avoid waisting memory
     298        QtFontSize *newPixelSizes = (QtFontSize *)malloc(sizeof(QtFontSize));
     299        Q_CHECK_PTR(newPixelSizes);
     300        pixelSizes = newPixelSizes;
     301    } else if (!(count % 8) || count == 1) {
    297302        QtFontSize *newPixelSizes = (QtFontSize *)
    298303                     realloc(pixelSizes,
     
    421426#endif
    422427#ifdef Q_WS_X11
    423     bool symbol_checked;
     428    bool symbol_checked;
    424429#endif
    425430
     
    635640    ~QFontDatabasePrivate() {
    636641        free();
     642
     643
     644
     645
    637646    }
    638647    QtFontFamily *family(const QString &f, bool = false);
     
    643652        families = 0;
    644653        count = 0;
    645 #if defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE)
    646         if (symbianExtras) {
    647             delete symbianExtras;
    648             symbianExtras = 0;
    649         }
    650 #endif
    651654        // don't clear the memory fonts!
    652655    }
     
    664667#elif defined(Q_WS_MAC)
    665668        ATSFontContainerRef handle;
     669
     670
     671
     672
    666673#endif
    667674        QStringList families;
     
    691698    QStringList fallbackFamilies;
    692699#elif defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE)
    693     const QSymbianFontDatabaseExtras *symbianExtras;
     700    QSymbianFontDatabaseExtras *symbianExtras;
    694701#endif
    695702
     
    25922599    currently not supported.
    25932600
     2601
     2602
    25942603    \sa addApplicationFontFromData(), applicationFontFamilies(), removeApplicationFont()
    25952604*/
     
    26222631    currently not supported.
    26232632
     2633
     2634
    26242635    \sa addApplicationFont(), applicationFontFamilies(), removeApplicationFont()
    26252636*/
Note: See TracChangeset for help on using the changeset viewer.