Changeset 373


Ignore:
Timestamp:
Dec 2, 2009, 5:16:18 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Correction for r372: Don't query PM_AssociateFont too often (patch by komh).

Location:
trunk/src/gui/text
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/text/qfont_pm.cpp

    r371 r373  
    7171    case QFont::AnyStyle:
    7272    default:
    73         static char szFontName[FACESIZE + 1] = {0,};
    74 
    75         // already queried ?
    76         if (szFontName[0] != ';') {
    77             szFontName[0] = ';';
    78             // query the associated font
    79             if (PrfQueryProfileString(HINI_USERPROFILE,
    80                                       "PM_SystemFonts", "PM_AssociateFont", 0,
    81                                       szFontName, sizeof(szFontName))) {
    82                 szFontName[FACESIZE] = '\0';
    83 
    84                 // the format of the associated font is face_name;point_size
    85                 // so remove ';' and later
    86                 for (PSZ pch = szFontName; *pch; pch++)
    87                     if (*pch == ';') {
    88                         *pch = '\0';
    89                         break;
    90                     }
    91             }
    92         }
    93 
    94         // is the associated font available ?
    95         if (szFontName[0] != '\0' && szFontName[0] != ';')
    96             family = szFontName;
    97         else if (request.fixedPitch)
     73        if (request.fixedPitch)
    9874            family = "Courier";
    9975        else
  • trunk/src/gui/text/qfontdatabase_pm.cpp

    r371 r373  
    752752}
    753753
     754
     755
     756
     757
     758
     759
     760
     761
     762
     763
     764
     765
     766
     767
     768
     769
     770
     771
     772
     773
     774
     775
     776
     777
     778
     779
     780
     781
     782
     783
     784
    754785static QFontEngine *loadPM(const QFontPrivate *d, int script, const QFontDef &req)
    755786{
     
    763794    // add the default family
    764795    QString defaultFamily = QApplication::font().family();
    765     if (! families.contains(defaultFamily))
     796    if (!families.contains(defaultFamily))
    766797        families << defaultFamily;
    767798
     
    769800    // previous versions
    770801    families << QApplication::font().defaultFamily();
     802
     803
     804
     805
     806
     807
    771808
    772809    // null family means find the first font matching the specified script
Note: See TracChangeset for help on using the changeset viewer.