qfont.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/text/qfont.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11bool QFontDef::exactMatch(const QFontDef &other) const-
12{-
13 if (pixelSize != -1
pixelSize != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& other.pixelSize != -1
other.pixelSize != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
14 if (pixelSize != other.pixelSize
pixelSize != other.pixelSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
15 return
never executed: return false;
false;
never executed: return false;
0
16 }
never executed: end of block
else if (pointSize != -1
pointSize != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& other.pointSize != -1
other.pointSize != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
17 if (pointSize != other.pointSize
pointSize != other.pointSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
18 return
never executed: return false;
false;
never executed: return false;
0
19 }
never executed: end of block
else {
0
20 return
never executed: return false;
false;
never executed: return false;
0
21 }-
22-
23 if (!ignorePitch
!ignorePitchDescription
TRUEnever evaluated
FALSEnever evaluated
&& !other.ignorePitch
!other.ignorePitchDescription
TRUEnever evaluated
FALSEnever evaluated
&& fixedPitch != other.fixedPitch
fixedPitch != other.fixedPitchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
24 return
never executed: return false;
false;
never executed: return false;
0
25-
26 if (stretch != 0
stretch != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& other.stretch != 0
other.stretch != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& stretch != other.stretch
stretch != other.stretchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
27 return
never executed: return false;
false;
never executed: return false;
0
28-
29 QString this_family, this_foundry, other_family, other_foundry;-
30 QFontDatabase::parseFontName(family, this_foundry, this_family);-
31 QFontDatabase::parseFontName(other.family, other_foundry, other_family);-
32-
33 return
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
(styleHint == other.styleHint
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
34 && styleStrategy == other.styleStrategy
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
35 && weight == other.weight
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
36 && style == other.style
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
37 && this_family == other_family
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
38 && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName)
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
39 && (this_foundry.isEmpty()
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
40 || other_foundry.isEmpty()
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
41 || this_foundry == other_foundry)
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
42 );
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
0
43}-
44-
45extern bool qt_is_gui_used;-
46-
47__attribute__((visibility("default"))) int qt_defaultDpiX()-
48{-
49 if (QCoreApplication::instance()->testAttribute(Qt::AA_Use96Dpi)
QCoreApplicati...::AA_Use96Dpi)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
50 return
never executed: return 96;
96;
never executed: return 96;
0
51-
52 if (!qt_is_gui_used
!qt_is_gui_usedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
53 return
never executed: return 75;
75;
never executed: return 75;
0
54-
55 if (const
const QScreen ...rimaryScreen()Description
TRUEnever evaluated
FALSEnever evaluated
QScreen *screen = QGuiApplication::primaryScreen()
const QScreen ...rimaryScreen()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
56 return
never executed: return qRound(screen->logicalDotsPerInchX());
qRound(screen->logicalDotsPerInchX());
never executed: return qRound(screen->logicalDotsPerInchX());
0
57-
58-
59 return
never executed: return 100;
100;
never executed: return 100;
0
60}-
61-
62__attribute__((visibility("default"))) int qt_defaultDpiY()-
63{-
64 if (QCoreApplication::instance()->testAttribute(Qt::AA_Use96Dpi)
QCoreApplicati...::AA_Use96Dpi)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
65 return
never executed: return 96;
96;
never executed: return 96;
0
66-
67 if (!qt_is_gui_used
!qt_is_gui_usedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
68 return
never executed: return 75;
75;
never executed: return 75;
0
69-
70 if (const
const QScreen ...rimaryScreen()Description
TRUEnever evaluated
FALSEnever evaluated
QScreen *screen = QGuiApplication::primaryScreen()
const QScreen ...rimaryScreen()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
71 return
never executed: return qRound(screen->logicalDotsPerInchY());
qRound(screen->logicalDotsPerInchY());
never executed: return qRound(screen->logicalDotsPerInchY());
0
72-
73-
74 return
never executed: return 100;
100;
never executed: return 100;
0
75}-
76-
77__attribute__((visibility("default"))) int qt_defaultDpi()-
78{-
79 return
never executed: return qt_defaultDpiY();
qt_defaultDpiY();
never executed: return qt_defaultDpiY();
0
80}-
81-
82QFontPrivate::QFontPrivate()-
83 : engineData(0), dpi(qt_defaultDpi()), screen(0),-
84 underline(false), overline(false), strikeOut(false), kerning(true),-
85 capital(0), letterSpacingIsAbsolute(false), scFont(0)-
86{-
87}
never executed: end of block
0
88-
89QFontPrivate::QFontPrivate(const QFontPrivate &other)-
90 : request(other.request), engineData(0), dpi(other.dpi), screen(other.screen),-
91 underline(other.underline), overline(other.overline),-
92 strikeOut(other.strikeOut), kerning(other.kerning),-
93 capital(other.capital), letterSpacingIsAbsolute(other.letterSpacingIsAbsolute),-
94 letterSpacing(other.letterSpacing), wordSpacing(other.wordSpacing),-
95 scFont(other.scFont)-
96{-
97 if (scFont
scFontDescription
TRUEnever evaluated
FALSEnever evaluated
&& scFont != this
scFont != thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
98 scFont->ref.ref();
never executed: scFont->ref.ref();
0
99}
never executed: end of block
0
100-
101QFontPrivate::~QFontPrivate()-
102{-
103 if (engineData
engineDataDescription
TRUEnever evaluated
FALSEnever evaluated
&& !engineData->ref.deref()
!engineData->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
104 delete engineData;
never executed: delete engineData;
0
105 engineData = 0;-
106 if (scFont
scFontDescription
TRUEnever evaluated
FALSEnever evaluated
&& scFont != this
scFont != thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
107 scFont->ref.deref();
never executed: scFont->ref.deref();
0
108 scFont = 0;-
109}
never executed: end of block
0
110-
111extern QMutex *qt_fontdatabase_mutex();-
112-
113-
114-
115QFontEngine *QFontPrivate::engineForScript(int script) const-
116{-
117 QMutexLocker locker(qt_fontdatabase_mutex());-
118 if (script <= QChar::Script_Latin
script <= QChar::Script_LatinDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
119 script = QChar::Script_Common;
never executed: script = QChar::Script_Common;
0
120 if (engineData
engineDataDescription
TRUEnever evaluated
FALSEnever evaluated
&& engineData->fontCacheId != QFontCache::instance()->id()
engineData->fo...stance()->id()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
121-
122 if (!engineData->ref.deref()
!engineData->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
123 delete engineData;
never executed: delete engineData;
0
124 engineData = 0;-
125 }
never executed: end of block
0
126 if (!engineData
!engineDataDescription
TRUEnever evaluated
FALSEnever evaluated
|| !engineData->engines[script]
!engineData->engines[script]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
127 QFontDatabase::load(this, script);
never executed: QFontDatabase::load(this, script);
0
128 return
never executed: return engineData->engines[script];
engineData->engines[script];
never executed: return engineData->engines[script];
0
129}-
130-
131void QFontPrivate::alterCharForCapitalization(QChar &c) const {-
132 switch (capital) {-
133 case
never executed: case QFont::AllUppercase:
QFont::AllUppercase:
never executed: case QFont::AllUppercase:
0
134 case
never executed: case QFont::SmallCaps:
QFont::SmallCaps:
never executed: case QFont::SmallCaps:
0
135 c = c.toUpper();-
136 break;
never executed: break;
0
137 case
never executed: case QFont::AllLowercase:
QFont::AllLowercase:
never executed: case QFont::AllLowercase:
0
138 c = c.toLower();-
139 break;
never executed: break;
0
140 case
never executed: case QFont::MixedCase:
QFont::MixedCase:
never executed: case QFont::MixedCase:
0
141 break;
never executed: break;
0
142 }-
143}
never executed: end of block
0
144-
145QFontPrivate *QFontPrivate::smallCapsFontPrivate() const-
146{-
147 if (scFont
scFontDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
148 return
never executed: return scFont;
scFont;
never executed: return scFont;
0
149 QFont font(const_cast<QFontPrivate *>(this));-
150 qreal pointSize = font.pointSizeF();-
151 if (pointSize > 0
pointSize > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
152 font.setPointSizeF(pointSize * .7);
never executed: font.setPointSizeF(pointSize * .7);
0
153 else-
154 font.setPixelSize((font.pixelSize() * 7 + 5) / 10);
never executed: font.setPixelSize((font.pixelSize() * 7 + 5) / 10);
0
155 scFont = font.d.data();-
156 if (scFont != this
scFont != thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
157 scFont->ref.ref();
never executed: scFont->ref.ref();
0
158 return
never executed: return scFont;
scFont;
never executed: return scFont;
0
159}-
160-
161-
162void QFontPrivate::resolve(uint mask, const QFontPrivate *other)-
163{-
164 ((!(other != 0)) ? qt_assert("other != 0",__FILE__,254) : qt_noop());-
165-
166 dpi = other->dpi;-
167-
168 if ((
(mask & QFont:...ertiesResolvedDescription
TRUEnever evaluated
FALSEnever evaluated
mask & QFont::AllPropertiesResolved) == QFont::AllPropertiesResolved
(mask & QFont:...ertiesResolvedDescription
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
0
169-
170-
171 if (! (mask & QFont::FamilyResolved)
! (mask & QFon...amilyResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
172 request.family = other->request.family;
never executed: request.family = other->request.family;
0
173-
174 if (! (mask & QFont::StyleNameResolved)
! (mask & QFon...eNameResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
175 request.styleName = other->request.styleName;
never executed: request.styleName = other->request.styleName;
0
176-
177 if (! (mask & QFont::SizeResolved)
! (mask & QFont::SizeResolved)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
178 request.pointSize = other->request.pointSize;-
179 request.pixelSize = other->request.pixelSize;-
180 }
never executed: end of block
0
181-
182 if (! (mask & QFont::StyleHintResolved)
! (mask & QFon...eHintResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
183 request.styleHint = other->request.styleHint;
never executed: request.styleHint = other->request.styleHint;
0
184-
185 if (! (mask & QFont::StyleStrategyResolved)
! (mask & QFon...ategyResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
186 request.styleStrategy = other->request.styleStrategy;
never executed: request.styleStrategy = other->request.styleStrategy;
0
187-
188 if (! (mask & QFont::WeightResolved)
! (mask & QFon...eightResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
189 request.weight = other->request.weight;
never executed: request.weight = other->request.weight;
0
190-
191 if (! (mask & QFont::StyleResolved)
! (mask & QFon...StyleResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
192 request.style = other->request.style;
never executed: request.style = other->request.style;
0
193-
194 if (! (mask & QFont::FixedPitchResolved)
! (mask & QFon...PitchResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
195 request.fixedPitch = other->request.fixedPitch;
never executed: request.fixedPitch = other->request.fixedPitch;
0
196-
197 if (! (mask & QFont::StretchResolved)
! (mask & QFon...retchResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
198 request.stretch = other->request.stretch;
never executed: request.stretch = other->request.stretch;
0
199-
200 if (! (mask & QFont::HintingPreferenceResolved)
! (mask & QFon...renceResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
201 request.hintingPreference = other->request.hintingPreference;
never executed: request.hintingPreference = other->request.hintingPreference;
0
202-
203 if (! (mask & QFont::UnderlineResolved)
! (mask & QFon...rlineResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
204 underline = other->underline;
never executed: underline = other->underline;
0
205-
206 if (! (mask & QFont::OverlineResolved)
! (mask & QFon...rlineResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
207 overline = other->overline;
never executed: overline = other->overline;
0
208-
209 if (! (mask & QFont::StrikeOutResolved)
! (mask & QFon...keOutResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
210 strikeOut = other->strikeOut;
never executed: strikeOut = other->strikeOut;
0
211-
212 if (! (mask & QFont::KerningResolved)
! (mask & QFon...rningResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
213 kerning = other->kerning;
never executed: kerning = other->kerning;
0
214-
215 if (! (mask & QFont::LetterSpacingResolved)
! (mask & QFon...acingResolved)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
216 letterSpacing = other->letterSpacing;-
217 letterSpacingIsAbsolute = other->letterSpacingIsAbsolute;-
218 }
never executed: end of block
0
219 if (! (mask & QFont::WordSpacingResolved)
! (mask & QFon...acingResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
220 wordSpacing = other->wordSpacing;
never executed: wordSpacing = other->wordSpacing;
0
221 if (! (mask & QFont::CapitalizationResolved)
! (mask & QFon...ationResolved)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
222 capital = other->capital;
never executed: capital = other->capital;
0
223}
never executed: end of block
0
224-
225-
226-
227-
228QFontEngineData::QFontEngineData()-
229 : ref(0), fontCacheId(QFontCache::instance()->id())-
230{-
231 memset(engines, 0, QChar::ScriptCount * sizeof(QFontEngine *));-
232}
never executed: end of block
0
233-
234QFontEngineData::~QFontEngineData()-
235{-
236 ((!(ref.load() == 0)) ? qt_assert("ref.load() == 0",__FILE__,326) : qt_noop());-
237 for (int i = 0; i < QChar::ScriptCount
i < QChar::ScriptCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
238 if (engines[i]
engines[i]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
239 if (!engines[i]->ref.deref()
!engines[i]->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
240 delete engines[i];
never executed: delete engines[i];
0
241 engines[i] = 0;-
242 }
never executed: end of block
0
243 }
never executed: end of block
0
244}
never executed: end of block
0
245QFont::QFont(const QFont &font, QPaintDevice *pd)-
246 : resolve_mask(font.resolve_mask)-
247{-
248 ((!(pd != 0)) ? qt_assert("pd != 0",__FILE__,549) : qt_noop());-
249 int dpi = pd->logicalDpiY();-
250 const int screen = 0;-
251 if (font.d->dpi != dpi
font.d->dpi != dpiDescription
TRUEnever evaluated
FALSEnever evaluated
|| font.d->screen != screen
font.d->screen != screenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
252 d = new QFontPrivate(*font.d);-
253 d->dpi = dpi;-
254 d->screen = screen;-
255 }
never executed: end of block
else {
0
256 d = font.d;-
257 }
never executed: end of block
0
258}-
259-
260-
261-
262-
263QFont::QFont(QFontPrivate *data)-
264 : d(data), resolve_mask(QFont::AllPropertiesResolved)-
265{-
266}
never executed: end of block
0
267-
268-
269-
270-
271void QFont::detach()-
272{-
273 if (d->ref.load() == 1
d->ref.load() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
274 if (d->engineData
d->engineDataDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d->engineData->ref.deref()
!d->engineData->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
275 delete d->engineData;
never executed: delete d->engineData;
0
276 d->engineData = 0;-
277 if (d->scFont
d->scFontDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->scFont != d.data()
d->scFont != d.data()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
278 d->scFont->ref.deref();
never executed: d->scFont->ref.deref();
0
279 d->scFont = 0;-
280 return;
never executed: return;
0
281 }-
282-
283 d.detach();-
284}
never executed: end of block
0
285-
286-
287-
288-
289-
290-
291-
292void QFontPrivate::detachButKeepEngineData(QFont *font)-
293{-
294 if (font->d->ref.load() == 1
font->d->ref.load() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
295 return;
never executed: return;
0
296-
297 QFontEngineData *engineData = font->d->engineData;-
298 if (engineData
engineDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
299 engineData->ref.ref();
never executed: engineData->ref.ref();
0
300 font->d.detach();-
301 font->d->engineData = engineData;-
302}
never executed: end of block
0
303-
304-
305-
306-
307-
308-
309QFont::QFont()-
310 : d(QGuiApplicationPrivate::instance() ? QGuiApplication::font().d.data() : new QFontPrivate()), resolve_mask(0)-
311{-
312}
never executed: end of block
0
313QFont::QFont(const QString &family, int pointSize, int weight, bool italic)-
314 : d(new QFontPrivate()), resolve_mask(QFont::FamilyResolved)-
315{-
316 if (pointSize <= 0
pointSize <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
317 pointSize = 12;-
318 }
never executed: end of block
else {
0
319 resolve_mask |= QFont::SizeResolved;-
320 }
never executed: end of block
0
321-
322 if (weight < 0
weight < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
323 weight = Normal;-
324 }
never executed: end of block
else {
0
325 resolve_mask |= QFont::WeightResolved | QFont::StyleResolved;-
326 }
never executed: end of block
0
327-
328 if (italic
italicDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
329 resolve_mask |= QFont::StyleResolved;
never executed: resolve_mask |= QFont::StyleResolved;
0
330-
331 d->request.family = family;-
332 d->request.pointSize = qreal(pointSize);-
333 d->request.pixelSize = -1;-
334 d->request.weight = weight;-
335 d->request.style = italic
italicDescription
TRUEnever evaluated
FALSEnever evaluated
? QFont::StyleItalic : QFont::StyleNormal;
0
336}
never executed: end of block
0
337-
338-
339-
340-
341QFont::QFont(const QFont &font)-
342 : d(font.d), resolve_mask(font.resolve_mask)-
343{-
344}
never executed: end of block
0
345-
346-
347-
348-
349QFont::~QFont()-
350{-
351}-
352-
353-
354-
355-
356QFont &QFont::operator=(const QFont &font)-
357{-
358 d = font.d;-
359 resolve_mask = font.resolve_mask;-
360 return
never executed: return *this;
*this;
never executed: return *this;
0
361}-
362QString QFont::family() const-
363{-
364 return
never executed: return d->request.family;
d->request.family;
never executed: return d->request.family;
0
365}-
366void QFont::setFamily(const QString &family)-
367{-
368 if ((
(resolve_mask ...amilyResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::FamilyResolved)
(resolve_mask ...amilyResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->request.family == family
d->request.family == familyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
369 return;
never executed: return;
0
370-
371 detach();-
372-
373 d->request.family = family;-
374-
375 resolve_mask |= QFont::FamilyResolved;-
376}
never executed: end of block
0
377QString QFont::styleName() const-
378{-
379 return
never executed: return d->request.styleName;
d->request.styleName;
never executed: return d->request.styleName;
0
380}-
381void QFont::setStyleName(const QString &styleName)-
382{-
383 if ((
(resolve_mask ...eNameResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::StyleNameResolved)
(resolve_mask ...eNameResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->request.styleName == styleName
d->request.sty...e == styleNameDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
384 return;
never executed: return;
0
385-
386 detach();-
387-
388 d->request.styleName = styleName;-
389 resolve_mask |= QFont::StyleNameResolved;-
390}
never executed: end of block
0
391-
392-
393-
394-
395-
396-
397-
398int QFont::pointSize() const-
399{-
400 return
never executed: return qRound(d->request.pointSize);
qRound(d->request.pointSize);
never executed: return qRound(d->request.pointSize);
0
401}-
402void QFont::setHintingPreference(HintingPreference hintingPreference)-
403{-
404 if ((
(resolve_mask ...renceResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::HintingPreferenceResolved)
(resolve_mask ...renceResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->request.hintingPreference == hintingPreference
d->request.hin...tingPreferenceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
405 return;
never executed: return;
0
406-
407 detach();-
408-
409 d->request.hintingPreference = hintingPreference;-
410-
411 resolve_mask |= QFont::HintingPreferenceResolved;-
412}
never executed: end of block
0
413-
414-
415-
416-
417-
418-
419QFont::HintingPreference QFont::hintingPreference() const-
420{-
421 return
never executed: return QFont::HintingPreference(d->request.hintingPreference);
QFont::HintingPreference(d->request.hintingPreference);
never executed: return QFont::HintingPreference(d->request.hintingPreference);
0
422}-
423-
424-
425-
426-
427-
428-
429-
430void QFont::setPointSize(int pointSize)-
431{-
432 if (pointSize <= 0
pointSize <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
433 QMessageLogger(__FILE__, 884, __PRETTY_FUNCTION__).warning("QFont::setPointSize: Point size <= 0 (%d), must be greater than 0", pointSize);-
434 return;
never executed: return;
0
435 }-
436-
437 if ((
(resolve_mask ...:SizeResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::SizeResolved)
(resolve_mask ...:SizeResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->request.pointSize == qreal(pointSize)
d->request.poi...eal(pointSize)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
438 return;
never executed: return;
0
439-
440 detach();-
441-
442 d->request.pointSize = qreal(pointSize);-
443 d->request.pixelSize = -1;-
444-
445 resolve_mask |= QFont::SizeResolved;-
446}
never executed: end of block
0
447void QFont::setPointSizeF(qreal pointSize)-
448{-
449 if (pointSize <= 0
pointSize <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
450 QMessageLogger(__FILE__, 909, __PRETTY_FUNCTION__).warning("QFont::setPointSizeF: Point size <= 0 (%f), must be greater than 0", pointSize);-
451 return;
never executed: return;
0
452 }-
453-
454 if ((
(resolve_mask ...:SizeResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::SizeResolved)
(resolve_mask ...:SizeResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->request.pointSize == pointSize
d->request.poi...e == pointSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
455 return;
never executed: return;
0
456-
457 detach();-
458-
459 d->request.pointSize = pointSize;-
460 d->request.pixelSize = -1;-
461-
462 resolve_mask |= QFont::SizeResolved;-
463}
never executed: end of block
0
464-
465-
466-
467-
468-
469-
470-
471qreal QFont::pointSizeF() const-
472{-
473 return
never executed: return d->request.pointSize;
d->request.pointSize;
never executed: return d->request.pointSize;
0
474}-
475void QFont::setPixelSize(int pixelSize)-
476{-
477 if (pixelSize <= 0
pixelSize <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
478 QMessageLogger(__FILE__, 947, __PRETTY_FUNCTION__).warning("QFont::setPixelSize: Pixel size <= 0 (%d)", pixelSize);-
479 return;
never executed: return;
0
480 }-
481-
482 if ((
(resolve_mask ...:SizeResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::SizeResolved)
(resolve_mask ...:SizeResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->request.pixelSize == qreal(pixelSize)
d->request.pix...eal(pixelSize)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
483 return;
never executed: return;
0
484-
485 detach();-
486-
487 d->request.pixelSize = pixelSize;-
488 d->request.pointSize = -1;-
489-
490 resolve_mask |= QFont::SizeResolved;-
491}
never executed: end of block
0
492int QFont::pixelSize() const-
493{-
494 return
never executed: return d->request.pixelSize;
d->request.pixelSize;
never executed: return d->request.pixelSize;
0
495}-
496QFont::Style QFont::style() const-
497{-
498 return
never executed: return (QFont::Style)d->request.style;
(QFont::Style)d->request.style;
never executed: return (QFont::Style)d->request.style;
0
499}-
500-
501-
502-
503-
504-
505-
506-
507void QFont::setStyle(Style style)-
508{-
509 if ((
(resolve_mask ...StyleResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::StyleResolved)
(resolve_mask ...StyleResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->request.style == style
d->request.style == styleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
510 return;
never executed: return;
0
511-
512 detach();-
513-
514 d->request.style = style;-
515 resolve_mask |= QFont::StyleResolved;-
516}
never executed: end of block
0
517-
518-
519-
520-
521-
522-
523-
524int QFont::weight() const-
525{-
526 return
never executed: return d->request.weight;
d->request.weight;
never executed: return d->request.weight;
0
527}-
528void QFont::setWeight(int weight)-
529{-
530 ((!(weight >= 0 && weight <= 99)) ? qt_assert_x("QFont::setWeight", "Weight must be between 0 and 99",__FILE__,1057) : qt_noop());-
531-
532 if ((
(resolve_mask ...eightResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::WeightResolved)
(resolve_mask ...eightResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->request.weight == weight
d->request.weight == weightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
533 return;
never executed: return;
0
534-
535 detach();-
536-
537 d->request.weight = weight;-
538 resolve_mask |= QFont::WeightResolved;-
539}
never executed: end of block
0
540bool QFont::underline() const-
541{-
542 return
never executed: return d->underline;
d->underline;
never executed: return d->underline;
0
543}-
544-
545-
546-
547-
548-
549-
550-
551void QFont::setUnderline(bool enable)-
552{-
553 if ((
(resolve_mask ...rlineResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::UnderlineResolved)
(resolve_mask ...rlineResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->underline == enable
d->underline == enableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
554 return;
never executed: return;
0
555-
556 QFontPrivate::detachButKeepEngineData(this);-
557-
558 d->underline = enable;-
559 resolve_mask |= QFont::UnderlineResolved;-
560}
never executed: end of block
0
561-
562-
563-
564-
565-
566-
567bool QFont::overline() const-
568{-
569 return
never executed: return d->overline;
d->overline;
never executed: return d->overline;
0
570}-
571-
572-
573-
574-
575-
576-
577void QFont::setOverline(bool enable)-
578{-
579 if ((
(resolve_mask ...rlineResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::OverlineResolved)
(resolve_mask ...rlineResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->overline == enable
d->overline == enableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
580 return;
never executed: return;
0
581-
582 QFontPrivate::detachButKeepEngineData(this);-
583-
584 d->overline = enable;-
585 resolve_mask |= QFont::OverlineResolved;-
586}
never executed: end of block
0
587-
588-
589-
590-
591-
592-
593bool QFont::strikeOut() const-
594{-
595 return
never executed: return d->strikeOut;
d->strikeOut;
never executed: return d->strikeOut;
0
596}-
597-
598-
599-
600-
601-
602-
603-
604void QFont::setStrikeOut(bool enable)-
605{-
606 if ((
(resolve_mask ...keOutResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::StrikeOutResolved)
(resolve_mask ...keOutResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->strikeOut == enable
d->strikeOut == enableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
607 return;
never executed: return;
0
608-
609 QFontPrivate::detachButKeepEngineData(this);-
610-
611 d->strikeOut = enable;-
612 resolve_mask |= QFont::StrikeOutResolved;-
613}
never executed: end of block
0
614-
615-
616-
617-
618-
619-
620bool QFont::fixedPitch() const-
621{-
622 return
never executed: return d->request.fixedPitch;
d->request.fixedPitch;
never executed: return d->request.fixedPitch;
0
623}-
624-
625-
626-
627-
628-
629-
630-
631void QFont::setFixedPitch(bool enable)-
632{-
633 if ((
(resolve_mask ...PitchResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::FixedPitchResolved)
(resolve_mask ...PitchResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->request.fixedPitch == enable
d->request.fix...itch == enableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
634 return;
never executed: return;
0
635-
636 detach();-
637-
638 d->request.fixedPitch = enable;-
639 d->request.ignorePitch = false;-
640 resolve_mask |= QFont::FixedPitchResolved;-
641}
never executed: end of block
0
642-
643-
644-
645-
646-
647-
648bool QFont::kerning() const-
649{-
650 return
never executed: return d->kerning;
d->kerning;
never executed: return d->kerning;
0
651}-
652void QFont::setKerning(bool enable)-
653{-
654 if ((
(resolve_mask ...rningResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::KerningResolved)
(resolve_mask ...rningResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->kerning == enable
d->kerning == enableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
655 return;
never executed: return;
0
656-
657 QFontPrivate::detachButKeepEngineData(this);-
658-
659 d->kerning = enable;-
660 resolve_mask |= QFont::KerningResolved;-
661}
never executed: end of block
0
662QFont::StyleStrategy QFont::styleStrategy() const-
663{-
664 return
never executed: return (StyleStrategy) d->request.styleStrategy;
(StyleStrategy) d->request.styleStrategy;
never executed: return (StyleStrategy) d->request.styleStrategy;
0
665}-
666QFont::StyleHint QFont::styleHint() const-
667{-
668 return
never executed: return (StyleHint) d->request.styleHint;
(StyleHint) d->request.styleHint;
never executed: return (StyleHint) d->request.styleHint;
0
669}-
670void QFont::setStyleHint(StyleHint hint, StyleStrategy strategy)-
671{-
672 if ((
(resolve_mask ...tegyResolved))Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & (QFont::StyleHintResolved | QFont::StyleStrategyResolved))
(resolve_mask ...tegyResolved))Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
673 (
(StyleHint) d-...leHint == hintDescription
TRUEnever evaluated
FALSEnever evaluated
StyleHint) d->request.styleHint == hint
(StyleHint) d-...leHint == hintDescription
TRUEnever evaluated
FALSEnever evaluated
&&
0
674 (
(StyleStrategy...gy == strategyDescription
TRUEnever evaluated
FALSEnever evaluated
StyleStrategy) d->request.styleStrategy == strategy
(StyleStrategy...gy == strategyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
675 return;
never executed: return;
0
676-
677 detach();-
678-
679 d->request.styleHint = hint;-
680 d->request.styleStrategy = strategy;-
681 resolve_mask |= QFont::StyleHintResolved;-
682 resolve_mask |= QFont::StyleStrategyResolved;-
683-
684}
never executed: end of block
0
685-
686-
687-
688-
689-
690-
691void QFont::setStyleStrategy(StyleStrategy s)-
692{-
693 if ((
(resolve_mask ...ategyResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::StyleStrategyResolved)
(resolve_mask ...ategyResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
694 s == (StyleStrategy)d->request.styleStrategy
s == (StyleStr....styleStrategyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
695 return;
never executed: return;
0
696-
697 detach();-
698-
699 d->request.styleStrategy = s;-
700 resolve_mask |= QFont::StyleStrategyResolved;-
701}
never executed: end of block
0
702int QFont::stretch() const-
703{-
704 return
never executed: return d->request.stretch;
d->request.stretch;
never executed: return d->request.stretch;
0
705}-
706void QFont::setStretch(int factor)-
707{-
708 if (factor < 1
factor < 1Description
TRUEnever evaluated
FALSEnever evaluated
|| factor > 4000
factor > 4000Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
709 QMessageLogger(__FILE__, 1419, __PRETTY_FUNCTION__).warning("QFont::setStretch: Parameter '%d' out of range", factor);-
710 return;
never executed: return;
0
711 }-
712-
713 if ((
(resolve_mask ...retchResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::StretchResolved)
(resolve_mask ...retchResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
714 d->request.stretch == (uint)factor
d->request.str...= (uint)factorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
715 return;
never executed: return;
0
716-
717 detach();-
718-
719 d->request.stretch = (uint)factor;-
720 resolve_mask |= QFont::StretchResolved;-
721}
never executed: end of block
0
722qreal QFont::letterSpacing() const-
723{-
724 return
never executed: return d->letterSpacing.toReal();
d->letterSpacing.toReal();
never executed: return d->letterSpacing.toReal();
0
725}-
726void QFont::setLetterSpacing(SpacingType type, qreal spacing)-
727{-
728 const QFixed newSpacing = QFixed::fromReal(spacing);-
729 const bool absoluteSpacing = type == AbsoluteSpacing;-
730 if ((
(resolve_mask ...acingResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::LetterSpacingResolved)
(resolve_mask ...acingResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
731 d->letterSpacingIsAbsolute == absoluteSpacing
d->letterSpaci...bsoluteSpacingDescription
TRUEnever evaluated
FALSEnever evaluated
&&
0
732 d->letterSpacing == newSpacing
d->letterSpacing == newSpacingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
733 return;
never executed: return;
0
734-
735 QFontPrivate::detachButKeepEngineData(this);-
736-
737 d->letterSpacing = newSpacing;-
738 d->letterSpacingIsAbsolute = absoluteSpacing;-
739 resolve_mask |= QFont::LetterSpacingResolved;-
740}
never executed: end of block
0
741-
742-
743-
744-
745-
746-
747-
748QFont::SpacingType QFont::letterSpacingType() const-
749{-
750 return
never executed: return d->letterSpacingIsAbsolute ? AbsoluteSpacing : PercentageSpacing;
d->letterSpacingIsAbsolute ? AbsoluteSpacing : PercentageSpacing;
never executed: return d->letterSpacingIsAbsolute ? AbsoluteSpacing : PercentageSpacing;
0
751}-
752-
753-
754-
755-
756-
757-
758-
759qreal QFont::wordSpacing() const-
760{-
761 return
never executed: return d->wordSpacing.toReal();
d->wordSpacing.toReal();
never executed: return d->wordSpacing.toReal();
0
762}-
763void QFont::setWordSpacing(qreal spacing)-
764{-
765 const QFixed newSpacing = QFixed::fromReal(spacing);-
766 if ((
(resolve_mask ...acingResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::WordSpacingResolved)
(resolve_mask ...acingResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
767 d->wordSpacing == newSpacing
d->wordSpacing == newSpacingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
768 return;
never executed: return;
0
769-
770 QFontPrivate::detachButKeepEngineData(this);-
771-
772 d->wordSpacing = newSpacing;-
773 resolve_mask |= QFont::WordSpacingResolved;-
774}
never executed: end of block
0
775void QFont::setCapitalization(Capitalization caps)-
776{-
777 if ((
(resolve_mask ...ationResolved)Description
TRUEnever evaluated
FALSEnever evaluated
resolve_mask & QFont::CapitalizationResolved)
(resolve_mask ...ationResolved)Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
778 capitalization() == caps
capitalization() == capsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
779 return;
never executed: return;
0
780-
781 QFontPrivate::detachButKeepEngineData(this);-
782-
783 d->capital = caps;-
784 resolve_mask |= QFont::CapitalizationResolved;-
785}
never executed: end of block
0
786-
787-
788-
789-
790-
791-
792-
793QFont::Capitalization QFont::capitalization() const-
794{-
795 return
never executed: return static_cast<QFont::Capitalization> (d->capital);
static_cast<QFont::Capitalization> (d->capital);
never executed: return static_cast<QFont::Capitalization> (d->capital);
0
796}-
797void QFont::setRawMode(bool)-
798{-
799}-
800bool QFont::exactMatch() const-
801{-
802 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
803 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,1610) : qt_noop());-
804 return
never executed: return d->request.exactMatch(engine->fontDef);
d->request.exactMatch(engine->fontDef);
never executed: return d->request.exactMatch(engine->fontDef);
0
805}-
806bool QFont::operator==(const QFont &f) const-
807{-
808 return
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
(f.d == d
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
809 || (f.d->request == d->request
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
810 && f.d->request.pointSize == d->request.pointSize
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
811 && f.d->underline == d->underline
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
812 && f.d->overline == d->overline
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
813 && f.d->strikeOut == d->strikeOut
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
814 && f.d->kerning == d->kerning
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
815 && f.d->capital == d->capital
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
816 && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
817 && f.d->letterSpacing == d->letterSpacing
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
818 && f.d->wordSpacing == d->wordSpacing
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
819 ));
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
0
820}-
821bool QFont::operator<(const QFont &f) const-
822{-
823 if (f.d == d
f.d == dDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return false;
false;
never executed: return false;
0
824-
825 const QFontDef &r1 = f.d->request;-
826 const QFontDef &r2 = d->request;-
827 if (r1.pointSize != r2.pointSize
r1.pointSize != r2.pointSizeDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return r1.pointSize < r2.pointSize;
r1.pointSize < r2.pointSize;
never executed: return r1.pointSize < r2.pointSize;
0
828 if (r1.pixelSize != r2.pixelSize
r1.pixelSize != r2.pixelSizeDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return r1.pixelSize < r2.pixelSize;
r1.pixelSize < r2.pixelSize;
never executed: return r1.pixelSize < r2.pixelSize;
0
829 if (r1.weight != r2.weight
r1.weight != r2.weightDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return r1.weight < r2.weight;
r1.weight < r2.weight;
never executed: return r1.weight < r2.weight;
0
830 if (r1.style != r2.style
r1.style != r2.styleDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return r1.style < r2.style;
r1.style < r2.style;
never executed: return r1.style < r2.style;
0
831 if (r1.stretch != r2.stretch
r1.stretch != r2.stretchDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return r1.stretch < r2.stretch;
r1.stretch < r2.stretch;
never executed: return r1.stretch < r2.stretch;
0
832 if (r1.styleHint != r2.styleHint
r1.styleHint != r2.styleHintDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return r1.styleHint < r2.styleHint;
r1.styleHint < r2.styleHint;
never executed: return r1.styleHint < r2.styleHint;
0
833 if (r1.styleStrategy != r2.styleStrategy
r1.styleStrate....styleStrategyDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return r1.styleStrategy < r2.styleStrategy;
r1.styleStrategy < r2.styleStrategy;
never executed: return r1.styleStrategy < r2.styleStrategy;
0
834 if (r1.family != r2.family
r1.family != r2.familyDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return r1.family < r2.family;
r1.family < r2.family;
never executed: return r1.family < r2.family;
0
835 if (f.d->capital != d->capital
f.d->capital != d->capitalDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return f.d->capital < d->capital;
f.d->capital < d->capital;
never executed: return f.d->capital < d->capital;
0
836-
837 if (f.d->letterSpacingIsAbsolute != d->letterSpacingIsAbsolute
f.d->letterSpa...cingIsAbsoluteDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return f.d->letterSpacingIsAbsolute < d->letterSpacingIsAbsolute;
f.d->letterSpacingIsAbsolute < d->letterSpacingIsAbsolute;
never executed: return f.d->letterSpacingIsAbsolute < d->letterSpacingIsAbsolute;
0
838 if (f.d->letterSpacing != d->letterSpacing
f.d->letterSpa...>letterSpacingDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return f.d->letterSpacing < d->letterSpacing;
f.d->letterSpacing < d->letterSpacing;
never executed: return f.d->letterSpacing < d->letterSpacing;
0
839 if (f.d->wordSpacing != d->wordSpacing
f.d->wordSpaci...d->wordSpacingDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return f.d->wordSpacing < d->wordSpacing;
f.d->wordSpacing < d->wordSpacing;
never executed: return f.d->wordSpacing < d->wordSpacing;
0
840-
841 int f1attrs = (f.d->underline << 3) + (f.d->overline << 2) + (f.d->strikeOut<<1) + f.d->kerning;-
842 int f2attrs = (d->underline << 3) + (d->overline << 2) + (d->strikeOut<<1) + d->kerning;-
843 return
never executed: return f1attrs < f2attrs;
f1attrs < f2attrs;
never executed: return f1attrs < f2attrs;
0
844}-
845bool QFont::operator!=(const QFont &f) const-
846{-
847 return
never executed: return !(operator==(f));
!(operator==(f));
never executed: return !(operator==(f));
0
848}-
849-
850-
851-
852-
853QFont::operator QVariant() const-
854{-
855 return
never executed: return QVariant(QVariant::Font, this);
QVariant(QVariant::Font, this);
never executed: return QVariant(QVariant::Font, this);
0
856}-
857bool QFont::isCopyOf(const QFont & f) const-
858{-
859 return
never executed: return d == f.d;
d == f.d;
never executed: return d == f.d;
0
860}-
861bool QFont::rawMode() const-
862{-
863 return
never executed: return false;
false;
never executed: return false;
0
864}-
865-
866-
867-
868-
869-
870-
871QFont QFont::resolve(const QFont &other) const-
872{-
873 if (resolve_mask == 0
resolve_mask == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| (resolve_mask == other.resolve_mask
resolve_mask =...r.resolve_maskDescription
TRUEnever evaluated
FALSEnever evaluated
&& *
*this == otherDescription
TRUEnever evaluated
FALSEnever evaluated
this == other
*this == otherDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
874 QFont o(other);-
875 o.resolve_mask = resolve_mask;-
876 return
never executed: return o;
o;
never executed: return o;
0
877 }-
878-
879 QFont font(*this);-
880 font.detach();-
881 font.d->resolve(resolve_mask, other.d.data());-
882-
883 return
never executed: return font;
font;
never executed: return font;
0
884}-
885typedef QHash<QString, QStringList> QFontSubst;-
886namespace { namespace Q_QGS_globalFontSubst { typedef QFontSubst Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QFontSubst, Q_QGS_globalFontSubst::innerFunction, Q_QGS_globalFontSubst::guard> globalFontSubst;
0
887QString QFont::substitute(const QString &familyName)-
888{-
889 QFontSubst *fontSubst = globalFontSubst();-
890 ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1777) : qt_noop());-
891 QFontSubst::ConstIterator it = fontSubst->constFind(familyName.toLower());-
892 if (it != fontSubst->constEnd()
it != fontSubst->constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
&& !(*it).isEmpty()
!(*it).isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
893 return
never executed: return (*it).first();
(*it).first();
never executed: return (*it).first();
0
894-
895 return
never executed: return familyName;
familyName;
never executed: return familyName;
0
896}-
897QStringList QFont::substitutes(const QString &familyName)-
898{-
899 QFontSubst *fontSubst = globalFontSubst();-
900 ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1798) : qt_noop());-
901 return
never executed: return fontSubst->value(familyName.toLower(), QStringList());
fontSubst->value(familyName.toLower(), QStringList());
never executed: return fontSubst->value(familyName.toLower(), QStringList());
0
902}-
903void QFont::insertSubstitution(const QString &familyName,-
904 const QString &substituteName)-
905{-
906 QFontSubst *fontSubst = globalFontSubst();-
907 ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1813) : qt_noop());-
908 QStringList &list = (*fontSubst)[familyName.toLower()];-
909 QString s = substituteName.toLower();-
910 if (!list.contains(s)
!list.contains(s)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
911 list.append(s);
never executed: list.append(s);
0
912}
never executed: end of block
0
913void QFont::insertSubstitutions(const QString &familyName,-
914 const QStringList &substituteNames)-
915{-
916 QFontSubst *fontSubst = globalFontSubst();-
917 ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1831) : qt_noop());-
918 QStringList &list = (*fontSubst)[familyName.toLower()];-
919 for (const QString &substituteName : substituteNames) {-
920 const QString lowerSubstituteName = substituteName.toLower();-
921 if (!list.contains(lowerSubstituteName)
!list.contains...ubstituteName)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
922 list.append(lowerSubstituteName);
never executed: list.append(lowerSubstituteName);
0
923 }
never executed: end of block
0
924}
never executed: end of block
0
925-
926-
927-
928-
929-
930-
931-
932void QFont::removeSubstitutions(const QString &familyName)-
933{-
934 QFontSubst *fontSubst = globalFontSubst();-
935 ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1849) : qt_noop());-
936 fontSubst->remove(familyName.toLower());-
937}
never executed: end of block
0
938QStringList QFont::substitutions()-
939{-
940 QFontSubst *fontSubst = globalFontSubst();-
941 ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1869) : qt_noop());-
942 QStringList ret = fontSubst->keys();-
943-
944 ret.sort();-
945 return
never executed: return ret;
ret;
never executed: return ret;
0
946}-
947-
948-
949-
950-
951-
952-
953static quint8 get_font_bits(int version, const QFontPrivate *f)-
954{-
955 ((!(f != 0)) ? qt_assert("f != 0",__FILE__,1883) : qt_noop());-
956 quint8 bits = 0;-
957 if (f->request.style
f->request.styleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
958 bits |= 0x01;
never executed: bits |= 0x01;
0
959 if (f->underline
f->underlineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
960 bits |= 0x02;
never executed: bits |= 0x02;
0
961 if (f->overline
f->overlineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
962 bits |= 0x40;
never executed: bits |= 0x40;
0
963 if (f->strikeOut
f->strikeOutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
964 bits |= 0x04;
never executed: bits |= 0x04;
0
965 if (f->request.fixedPitch
f->request.fixedPitchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
966 bits |= 0x08;
never executed: bits |= 0x08;
0
967-
968-
969 if (version >= QDataStream::Qt_4_0
version >= QDataStream::Qt_4_0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
970 if (f->kerning
f->kerningDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
971 bits |= 0x10;
never executed: bits |= 0x10;
0
972 }
never executed: end of block
0
973 if (f->request.style == QFont::StyleOblique
f->request.sty...::StyleObliqueDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
974 bits |= 0x80;
never executed: bits |= 0x80;
0
975 return
never executed: return bits;
bits;
never executed: return bits;
0
976}-
977-
978static quint8 get_extended_font_bits(const QFontPrivate *f)-
979{-
980 ((!(f != 0)) ? qt_assert("f != 0",__FILE__,1908) : qt_noop());-
981 quint8 bits = 0;-
982 if (f->request.ignorePitch
f->request.ignorePitchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
983 bits |= 0x01;
never executed: bits |= 0x01;
0
984 if (f->letterSpacingIsAbsolute
f->letterSpacingIsAbsoluteDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
985 bits |= 0x02;
never executed: bits |= 0x02;
0
986 return
never executed: return bits;
bits;
never executed: return bits;
0
987}-
988-
989-
990-
991-
992-
993static void set_font_bits(int version, quint8 bits, QFontPrivate *f)-
994{-
995 ((!(f != 0)) ? qt_assert("f != 0",__FILE__,1923) : qt_noop());-
996 f->request.style = (
(bits & 0x01) != 0Description
TRUEnever evaluated
FALSEnever evaluated
bits & 0x01) != 0
(bits & 0x01) != 0Description
TRUEnever evaluated
FALSEnever evaluated
? QFont::StyleItalic : QFont::StyleNormal;
0
997 f->underline = (bits & 0x02) != 0;-
998 f->overline = (bits & 0x40) != 0;-
999 f->strikeOut = (bits & 0x04) != 0;-
1000 f->request.fixedPitch = (bits & 0x08) != 0;-
1001-
1002 if (version >= QDataStream::Qt_4_0
version >= QDataStream::Qt_4_0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1003 f->kerning = (bits & 0x10) != 0;
never executed: f->kerning = (bits & 0x10) != 0;
0
1004 if ((
(bits & 0x80) != 0Description
TRUEnever evaluated
FALSEnever evaluated
bits & 0x80) != 0
(bits & 0x80) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1005 f->request.style = QFont::StyleOblique;
never executed: f->request.style = QFont::StyleOblique;
0
1006}
never executed: end of block
0
1007-
1008static void set_extended_font_bits(quint8 bits, QFontPrivate *f)-
1009{-
1010 ((!(f != 0)) ? qt_assert("f != 0",__FILE__,1938) : qt_noop());-
1011 f->request.ignorePitch = (bits & 0x01) != 0;-
1012 f->letterSpacingIsAbsolute = (bits & 0x02) != 0;-
1013}
never executed: end of block
0
1014QString QFont::rawName() const-
1015{-
1016 return
never executed: return QLatin1String("unknown");
QLatin1String("unknown");
never executed: return QLatin1String("unknown");
0
1017}-
1018void QFont::setRawName(const QString &)-
1019{-
1020}-
1021QString QFont::key() const-
1022{-
1023 return
never executed: return toString();
toString();
never executed: return toString();
0
1024}-
1025QString QFont::toString() const-
1026{-
1027 const QChar comma(QLatin1Char(','));-
1028 return
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
family() + comma +
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1029 QString::number( pointSizeF()) + comma +
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1030 QString::number( pixelSize()) + comma +
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1031 QString::number((int) styleHint()) + comma +
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1032 QString::number( weight()) + comma +
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1033 QString::number((int) style()) + comma +
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1034 QString::number((int) underline()) + comma +
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1035 QString::number((int) strikeOut()) + comma +
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1036 QString::number((int)fixedPitch()) + comma +
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1037 QString::number((int) false);
never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false);
0
1038}-
1039uint qHash(const QFont &font, uint seed) noexcept-
1040{-
1041 return
never executed: return qHash(QFontPrivate::get(font)->request, seed);
qHash(QFontPrivate::get(font)->request, seed);
never executed: return qHash(QFontPrivate::get(font)->request, seed);
0
1042}-
1043bool QFont::fromString(const QString &descrip)-
1044{-
1045 const auto l = descrip.splitRef(QLatin1Char(','));-
1046-
1047 int count = l.count();-
1048 if (!count
!countDescription
TRUEnever evaluated
FALSEnever evaluated
|| (count > 2
count > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& count < 9
count < 9Description
TRUEnever evaluated
FALSEnever evaluated
) || count > 11
count > 11Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1049 QMessageLogger(__FILE__, 2042, __PRETTY_FUNCTION__).warning("QFont::fromString: Invalid description '%s'",-
1050 descrip.isEmpty() ? "(empty)" : descrip.toLatin1().data());-
1051 return
never executed: return false;
false;
never executed: return false;
0
1052 }-
1053-
1054 setFamily(l[0].toString());-
1055 if (count > 1
count > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& l[1].toDouble() > 0.0
l[1].toDouble() > 0.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1056 setPointSizeF(l[1].toDouble());
never executed: setPointSizeF(l[1].toDouble());
0
1057 if (count == 9
count == 9Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1058 setStyleHint((StyleHint) l[2].toInt());-
1059 setWeight(qMax(qMin(99, l[3].toInt()), 0));-
1060 setItalic(l[4].toInt());-
1061 setUnderline(l[5].toInt());-
1062 setStrikeOut(l[6].toInt());-
1063 setFixedPitch(l[7].toInt());-
1064 }
never executed: end of block
else if (count == 10
count == 10Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1065 if (l[2].toInt() > 0
l[2].toInt() > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1066 setPixelSize(l[2].toInt());
never executed: setPixelSize(l[2].toInt());
0
1067 setStyleHint((StyleHint) l[3].toInt());-
1068 setWeight(qMax(qMin(99, l[4].toInt()), 0));-
1069 setStyle((QFont::Style)l[5].toInt());-
1070 setUnderline(l[6].toInt());-
1071 setStrikeOut(l[7].toInt());-
1072 setFixedPitch(l[8].toInt());-
1073 }
never executed: end of block
0
1074 if (count >= 9
count >= 9Description
TRUEnever evaluated
FALSEnever evaluated
&& !d->request.fixedPitch
!d->request.fixedPitchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1075 d->request.ignorePitch = true;
never executed: d->request.ignorePitch = true;
0
1076-
1077 return
never executed: return true;
true;
never executed: return true;
0
1078}-
1079void QFont::initialize()-
1080{-
1081}-
1082-
1083-
1084-
1085-
1086-
1087-
1088void QFont::cleanup()-
1089{-
1090 QFontCache::cleanup();-
1091}
never executed: end of block
0
1092-
1093-
1094-
1095-
1096-
1097void QFont::cacheStatistics()-
1098{-
1099}-
1100QString QFont::lastResortFamily() const-
1101{-
1102 return
never executed: return QString::fromLatin1("helvetica");
QString::fromLatin1("helvetica");
never executed: return QString::fromLatin1("helvetica");
0
1103}-
1104-
1105extern QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style,-
1106 QFont::StyleHint styleHint, QChar::Script script);-
1107QString QFont::defaultFamily() const-
1108{-
1109 const QStringList fallbacks = qt_fallbacksForFamily(QString(), QFont::StyleNormal-
1110 , QFont::StyleHint(d->request.styleHint), QChar::Script_Common);-
1111 if (!fallbacks.isEmpty()
!fallbacks.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1112 return
never executed: return fallbacks.first();
fallbacks.first();
never executed: return fallbacks.first();
0
1113 return
never executed: return QString();
QString();
never executed: return QString();
0
1114}-
1115QString QFont::lastResortFont() const-
1116{-
1117 QMessageLogger(__FILE__, 2161, __PRETTY_FUNCTION__).fatal("QFont::lastResortFont: Cannot find any reasonable font");-
1118-
1119 return
never executed: return QString();
QString();
never executed: return QString();
0
1120}-
1121QDataStream &operator<<(QDataStream &s, const QFont &font)-
1122{-
1123 if (s.version() == 1
s.version() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1124 s << font.d->request.family.toLatin1();-
1125 }
never executed: end of block
else {
0
1126 s << font.d->request.family;-
1127 if (s.version() >= QDataStream::Qt_5_4
s.version() >=...Stream::Qt_5_4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1128 s << font.d->request.styleName;
never executed: s << font.d->request.styleName;
0
1129 }
never executed: end of block
0
1130-
1131 if (s.version() >= QDataStream::Qt_4_0
s.version() >=...Stream::Qt_4_0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1132-
1133 double pointSize = font.d->request.pointSize;-
1134 qint32 pixelSize = font.d->request.pixelSize;-
1135 s << pointSize;-
1136 s << pixelSize;-
1137 }
never executed: end of block
else if (s.version() <= 3
s.version() <= 3Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1138 qint16 pointSize = (qint16) (font.d->request.pointSize * 10);-
1139 if (pointSize < 0
pointSize < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1140 pointSize = (qint16)QFontInfo(font).pointSize() * 10;-
1141 }
never executed: end of block
0
1142 s << pointSize;-
1143 }
never executed: end of block
else {
0
1144 s << (qint16) (font.d->request.pointSize * 10);-
1145 s << (qint16) font.d->request.pixelSize;-
1146 }
never executed: end of block
0
1147-
1148 s << (quint8) font.d->request.styleHint;-
1149 if (s.version() >= QDataStream::Qt_3_1
s.version() >=...Stream::Qt_3_1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1150-
1151-
1152 if (s.version() >= QDataStream::Qt_5_4
s.version() >=...Stream::Qt_5_4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1153 s << (quint16) font.d->request.styleStrategy;
never executed: s << (quint16) font.d->request.styleStrategy;
0
1154 else-
1155 s << (quint8) font.d->request.styleStrategy;
never executed: s << (quint8) font.d->request.styleStrategy;
0
1156 }-
1157 s << (quint8) 0-
1158 << (quint8) font.d->request.weight-
1159 << get_font_bits(s.version(), font.d.data());-
1160 if (s.version() >= QDataStream::Qt_4_3
s.version() >=...Stream::Qt_4_3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1161 s << (quint16)font.d->request.stretch;
never executed: s << (quint16)font.d->request.stretch;
0
1162 if (s.version() >= QDataStream::Qt_4_4
s.version() >=...Stream::Qt_4_4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1163 s << get_extended_font_bits(font.d.data());
never executed: s << get_extended_font_bits(font.d.data());
0
1164 if (s.version() >= QDataStream::Qt_4_5
s.version() >=...Stream::Qt_4_5Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1165 s << font.d->letterSpacing.value();-
1166 s << font.d->wordSpacing.value();-
1167 }
never executed: end of block
0
1168 if (s.version() >= QDataStream::Qt_5_4
s.version() >=...Stream::Qt_5_4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1169 s << (quint8)font.d->request.hintingPreference;
never executed: s << (quint8)font.d->request.hintingPreference;
0
1170 if (s.version() >= QDataStream::Qt_5_6
s.version() >=...Stream::Qt_5_6Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1171 s << (quint8)font.d->capital;
never executed: s << (quint8)font.d->capital;
0
1172 return
never executed: return s;
s;
never executed: return s;
0
1173}-
1174QDataStream &operator>>(QDataStream &s, QFont &font)-
1175{-
1176 font.d = new QFontPrivate;-
1177 font.resolve_mask = QFont::AllPropertiesResolved;-
1178-
1179 quint8 styleHint, charSet, weight, bits;-
1180 quint16 styleStrategy = QFont::PreferDefault;-
1181-
1182 if (s.version() == 1
s.version() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1183 QByteArray fam;-
1184 s >> fam;-
1185 font.d->request.family = QString::fromLatin1(fam);-
1186 }
never executed: end of block
else {
0
1187 s >> font.d->request.family;-
1188 if (s.version() >= QDataStream::Qt_5_4
s.version() >=...Stream::Qt_5_4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1189 s >> font.d->request.styleName;
never executed: s >> font.d->request.styleName;
0
1190 }
never executed: end of block
0
1191-
1192 if (s.version() >= QDataStream::Qt_4_0
s.version() >=...Stream::Qt_4_0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1193-
1194 double pointSize;-
1195 qint32 pixelSize;-
1196 s >> pointSize;-
1197 s >> pixelSize;-
1198 font.d->request.pointSize = qreal(pointSize);-
1199 font.d->request.pixelSize = pixelSize;-
1200 }
never executed: end of block
else {
0
1201 qint16 pointSize, pixelSize = -1;-
1202 s >> pointSize;-
1203 if (s.version() >= 4
s.version() >= 4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1204 s >> pixelSize;
never executed: s >> pixelSize;
0
1205 font.d->request.pointSize = qreal(pointSize / 10.);-
1206 font.d->request.pixelSize = pixelSize;-
1207 }
never executed: end of block
0
1208 s >> styleHint;-
1209 if (s.version() >= QDataStream::Qt_3_1
s.version() >=...Stream::Qt_3_1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1210 if (s.version() >= QDataStream::Qt_5_4
s.version() >=...Stream::Qt_5_4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1211 s >> styleStrategy;-
1212 }
never executed: end of block
else {
0
1213 quint8 tempStyleStrategy;-
1214 s >> tempStyleStrategy;-
1215 styleStrategy = tempStyleStrategy;-
1216 }
never executed: end of block
0
1217 }-
1218-
1219 s >> charSet;-
1220 s >> weight;-
1221 s >> bits;-
1222-
1223 font.d->request.styleHint = styleHint;-
1224 font.d->request.styleStrategy = styleStrategy;-
1225 font.d->request.weight = weight;-
1226-
1227 set_font_bits(s.version(), bits, font.d.data());-
1228-
1229 if (s.version() >= QDataStream::Qt_4_3
s.version() >=...Stream::Qt_4_3Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1230 quint16 stretch;-
1231 s >> stretch;-
1232 font.d->request.stretch = stretch;-
1233 }
never executed: end of block
0
1234-
1235 if (s.version() >= QDataStream::Qt_4_4
s.version() >=...Stream::Qt_4_4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1236 quint8 extendedBits;-
1237 s >> extendedBits;-
1238 set_extended_font_bits(extendedBits, font.d.data());-
1239 }
never executed: end of block
0
1240 if (s.version() >= QDataStream::Qt_4_5
s.version() >=...Stream::Qt_4_5Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1241 int value;-
1242 s >> value;-
1243 font.d->letterSpacing.setValue(value);-
1244 s >> value;-
1245 font.d->wordSpacing.setValue(value);-
1246 }
never executed: end of block
0
1247 if (s.version() >= QDataStream::Qt_5_4
s.version() >=...Stream::Qt_5_4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1248 quint8 value;-
1249 s >> value;-
1250 font.d->request.hintingPreference = QFont::HintingPreference(value);-
1251 }
never executed: end of block
0
1252 if (s.version() >= QDataStream::Qt_5_6
s.version() >=...Stream::Qt_5_6Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1253 quint8 value;-
1254 s >> value;-
1255 font.d->capital = QFont::Capitalization(value);-
1256 }
never executed: end of block
0
1257 return
never executed: return s;
s;
never executed: return s;
0
1258}-
1259QFontInfo::QFontInfo(const QFont &font)-
1260 : d(font.d)-
1261{-
1262}
never executed: end of block
0
1263-
1264-
1265-
1266-
1267QFontInfo::QFontInfo(const QFontInfo &fi)-
1268 : d(fi.d)-
1269{-
1270}
never executed: end of block
0
1271-
1272-
1273-
1274-
1275QFontInfo::~QFontInfo()-
1276{-
1277}-
1278-
1279-
1280-
1281-
1282QFontInfo &QFontInfo::operator=(const QFontInfo &fi)-
1283{-
1284 d = fi.d;-
1285 return
never executed: return *this;
*this;
never executed: return *this;
0
1286}-
1287QString QFontInfo::family() const-
1288{-
1289 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1290 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2440) : qt_noop());-
1291 return
never executed: return engine->fontDef.family;
engine->fontDef.family;
never executed: return engine->fontDef.family;
0
1292}-
1293QString QFontInfo::styleName() const-
1294{-
1295 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1296 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2455) : qt_noop());-
1297 return
never executed: return engine->fontDef.styleName;
engine->fontDef.styleName;
never executed: return engine->fontDef.styleName;
0
1298}-
1299-
1300-
1301-
1302-
1303-
1304-
1305int QFontInfo::pointSize() const-
1306{-
1307 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1308 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2467) : qt_noop());-
1309 return
never executed: return qRound(engine->fontDef.pointSize);
qRound(engine->fontDef.pointSize);
never executed: return qRound(engine->fontDef.pointSize);
0
1310}-
1311-
1312-
1313-
1314-
1315-
1316-
1317qreal QFontInfo::pointSizeF() const-
1318{-
1319 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1320 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2479) : qt_noop());-
1321 return
never executed: return engine->fontDef.pointSize;
engine->fontDef.pointSize;
never executed: return engine->fontDef.pointSize;
0
1322}-
1323-
1324-
1325-
1326-
1327-
1328-
1329int QFontInfo::pixelSize() const-
1330{-
1331 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1332 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2491) : qt_noop());-
1333 return
never executed: return engine->fontDef.pixelSize;
engine->fontDef.pixelSize;
never executed: return engine->fontDef.pixelSize;
0
1334}-
1335-
1336-
1337-
1338-
1339-
1340-
1341bool QFontInfo::italic() const-
1342{-
1343 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1344 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2503) : qt_noop());-
1345 return
never executed: return engine->fontDef.style != QFont::StyleNormal;
engine->fontDef.style != QFont::StyleNormal;
never executed: return engine->fontDef.style != QFont::StyleNormal;
0
1346}-
1347-
1348-
1349-
1350-
1351-
1352-
1353QFont::Style QFontInfo::style() const-
1354{-
1355 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1356 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2515) : qt_noop());-
1357 return
never executed: return (QFont::Style)engine->fontDef.style;
(QFont::Style)engine->fontDef.style;
never executed: return (QFont::Style)engine->fontDef.style;
0
1358}-
1359-
1360-
1361-
1362-
1363-
1364-
1365int QFontInfo::weight() const-
1366{-
1367 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1368 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2527) : qt_noop());-
1369 return
never executed: return engine->fontDef.weight;
engine->fontDef.weight;
never executed: return engine->fontDef.weight;
0
1370-
1371}-
1372bool QFontInfo::underline() const-
1373{-
1374 return
never executed: return d->underline;
d->underline;
never executed: return d->underline;
0
1375}-
1376bool QFontInfo::overline() const-
1377{-
1378 return
never executed: return d->overline;
d->overline;
never executed: return d->overline;
0
1379}-
1380bool QFontInfo::strikeOut() const-
1381{-
1382 return
never executed: return d->strikeOut;
d->strikeOut;
never executed: return d->strikeOut;
0
1383}-
1384-
1385-
1386-
1387-
1388-
1389-
1390bool QFontInfo::fixedPitch() const-
1391{-
1392 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1393 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2592) : qt_noop());-
1394 return
never executed: return engine->fontDef.fixedPitch;
engine->fontDef.fixedPitch;
never executed: return engine->fontDef.fixedPitch;
0
1395}-
1396QFont::StyleHint QFontInfo::styleHint() const-
1397{-
1398 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1399 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2618) : qt_noop());-
1400 return
never executed: return (QFont::StyleHint) engine->fontDef.styleHint;
(QFont::StyleHint) engine->fontDef.styleHint;
never executed: return (QFont::StyleHint) engine->fontDef.styleHint;
0
1401}-
1402bool QFontInfo::rawMode() const-
1403{-
1404 return
never executed: return false;
false;
never executed: return false;
0
1405}-
1406bool QFontInfo::exactMatch() const-
1407{-
1408 QFontEngine *engine = d->engineForScript(QChar::Script_Common);-
1409 ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2650) : qt_noop());-
1410 return
never executed: return d->request.exactMatch(engine->fontDef);
d->request.exactMatch(engine->fontDef);
never executed: return d->request.exactMatch(engine->fontDef);
0
1411}-
1412static const int fast_timeout = 10000;-
1413static const int slow_timeout = 300000;-
1414-
1415-
1416const uint QFontCache::min_cost = 4*1024;-
1417namespace { namespace Q_QGS_theFontCache { typedef QThreadStorage<QFontCache *> Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QThreadStorage<QFontCache *>, Q_QGS_theFontCache::innerFunction, Q_QGS_theFontCache::guard> theFontCache;
0
1418-
1419QFontCache *QFontCache::instance()-
1420{-
1421 QFontCache *&fontCache = theFontCache()->localData();-
1422 if (!fontCache
!fontCacheDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1423 fontCache = new QFontCache;
never executed: fontCache = new QFontCache;
0
1424 return
never executed: return fontCache;
fontCache;
never executed: return fontCache;
0
1425}-
1426-
1427void QFontCache::cleanup()-
1428{-
1429 QThreadStorage<QFontCache *> *cache = 0;-
1430 if (true) {-
1431 cache = theFontCache();-
1432 }
never executed: end of block
else {
dead code: { }
-
1433-
1434 }
dead code: { }
-
1435 if (cache
cacheDescription
TRUEnever evaluated
FALSEnever evaluated
&& cache->hasLocalData()
cache->hasLocalData()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1436 cache->setLocalData(0);
never executed: cache->setLocalData(0);
0
1437}
never executed: end of block
0
1438-
1439-
1440QBasicAtomicInt font_cache_id = { 1 };-
1441-
1442QFontCache::QFontCache()-
1443 : QObject(), total_cost(0), max_cost(min_cost),-
1444 current_timestamp(0), fast(false), timer_id(-1),-
1445 m_id(font_cache_id.fetchAndAddRelaxed(1))-
1446{-
1447}
never executed: end of block
0
1448-
1449QFontCache::~QFontCache()-
1450{-
1451 clear();-
1452}
never executed: end of block
0
1453-
1454void QFontCache::clear()-
1455{-
1456 {-
1457 EngineDataCache::Iterator it = engineDataCache.begin(),-
1458 end = engineDataCache.end();-
1459 while (it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1460 QFontEngineData *data = it.value();-
1461 for (int i = 0; i < QChar::ScriptCount
i < QChar::ScriptCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1462 if (data->engines[i]
data->engines[i]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1463 if (!data->engines[i]->ref.deref()
!data->engines[i]->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1464 ((!(engineCacheCount.value(data->engines[i]) == 0)) ? qt_assert("engineCacheCount.value(data->engines[i]) == 0",__FILE__,2731) : qt_noop());-
1465 delete data->engines[i];-
1466 }
never executed: end of block
0
1467 data->engines[i] = 0;-
1468 }
never executed: end of block
0
1469 }
never executed: end of block
0
1470 if (!data->ref.deref()
!data->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1471 delete data;-
1472 }
never executed: end of block
else {
0
1473 if (false) QMessageLogger(__FILE__, 2740, __PRETTY_FUNCTION__).debug("QFontCache::clear: engineData %p still has refcount %d",
dead code: QMessageLogger(__FILE__, 2740, __PRETTY_FUNCTION__).debug("QFontCache::clear: engineData %p still has refcount %d", data, data->ref.load());
-
1474 data, data->ref.load());
dead code: QMessageLogger(__FILE__, 2740, __PRETTY_FUNCTION__).debug("QFontCache::clear: engineData %p still has refcount %d", data, data->ref.load());
-
1475 }
never executed: end of block
0
1476 ++it;-
1477 }
never executed: end of block
0
1478 }-
1479-
1480 engineDataCache.clear();-
1481-
1482-
1483 bool mightHaveEnginesLeftForCleanup;-
1484 do {-
1485 mightHaveEnginesLeftForCleanup = false;-
1486 for (EngineCache::Iterator it = engineCache.begin(), end = engineCache.end();-
1487 it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
1488 QFontEngine *engine = it.value().data;-
1489 if (engine
engineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1490 const int cacheCount = --engineCacheCount[engine];-
1491 ((!(cacheCount >= 0)) ? qt_assert("cacheCount >= 0",__FILE__,2758) : qt_noop());-
1492 if (!engine->ref.deref()
!engine->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1493 ((!(cacheCount == 0)) ? qt_assert("cacheCount == 0",__FILE__,2760) : qt_noop());-
1494 mightHaveEnginesLeftForCleanup = engine->type() == QFontEngine::Multi;-
1495 delete engine;-
1496 }
never executed: end of block
else if (cacheCount == 0
cacheCount == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1497 if (false) QMessageLogger(__FILE__, 2764, __PRETTY_FUNCTION__).debug("QFontCache::clear: engine %p still has refcount %d",
dead code: QMessageLogger(__FILE__, 2764, __PRETTY_FUNCTION__).debug("QFontCache::clear: engine %p still has refcount %d", engine, engine->ref.load());
-
1498 engine, engine->ref.load());
dead code: QMessageLogger(__FILE__, 2764, __PRETTY_FUNCTION__).debug("QFontCache::clear: engine %p still has refcount %d", engine, engine->ref.load());
-
1499 }
never executed: end of block
0
1500 it.value().data = 0;-
1501 }
never executed: end of block
0
1502 }
never executed: end of block
0
1503 }
never executed: end of block
while (mightHaveEnginesLeftForCleanup
mightHaveEnginesLeftForCleanupDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
1504-
1505 engineCache.clear();-
1506 engineCacheCount.clear();-
1507-
1508-
1509 total_cost = 0;-
1510 max_cost = min_cost;-
1511}
never executed: end of block
0
1512-
1513-
1514QFontEngineData *QFontCache::findEngineData(const QFontDef &def) const-
1515{-
1516 EngineDataCache::ConstIterator it = engineDataCache.constFind(def);-
1517 if (it == engineDataCache.constEnd()
it == engineDa...che.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1518 return
never executed: return 0;
0;
never executed: return 0;
0
1519-
1520-
1521 return
never executed: return it.value();
it.value();
never executed: return it.value();
0
1522}-
1523-
1524void QFontCache::insertEngineData(const QFontDef &def, QFontEngineData *engineData)-
1525{-
1526 ((!(!engineDataCache.contains(def))) ? qt_assert("!engineDataCache.contains(def)",__FILE__,2801) : qt_noop());-
1527-
1528 engineData->ref.ref();-
1529-
1530 if (total_cost > min_cost * 2
total_cost > min_cost * 2Description
TRUEnever evaluated
FALSEnever evaluated
&& engineDataCache.size() >= 256
engineDataCache.size() >= 256Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1531 decreaseCache();
never executed: decreaseCache();
0
1532-
1533 engineDataCache.insert(def, engineData);-
1534 increaseCost(sizeof(QFontEngineData));-
1535}
never executed: end of block
0
1536-
1537QFontEngine *QFontCache::findEngine(const Key &key)-
1538{-
1539 EngineCache::Iterator it = engineCache.find(key),-
1540 end = engineCache.end();-
1541 if (it == end
it == endDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return 0;
0;
never executed: return 0;
0
1542-
1543 ((!(it.value().data != nullptr)) ? qt_assert("it.value().data != Q_NULLPTR",__FILE__,2818) : qt_noop());-
1544 ((!(key.multi == (it.value().data->type() == QFontEngine::Multi))) ? qt_assert("key.multi == (it.value().data->type() == QFontEngine::Multi)",__FILE__,2819) : qt_noop());-
1545-
1546-
1547 updateHitCountAndTimeStamp(it.value());-
1548-
1549 return
never executed: return it.value().data;
it.value().data;
never executed: return it.value().data;
0
1550}-
1551-
1552void QFontCache::updateHitCountAndTimeStamp(Engine &value)-
1553{-
1554 value.hits++;-
1555 value.timestamp = ++current_timestamp;-
1556-
1557 if (false) QMessageLogger(__FILE__, 2832, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n"
dead code: QMessageLogger(__FILE__, 2832, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type());
-
1558 " %p: timestamp %4u hits %3u ref %2d/%2d, type %d",
dead code: QMessageLogger(__FILE__, 2832, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type());
-
1559 value.data, value.timestamp, value.hits,
dead code: QMessageLogger(__FILE__, 2832, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type());
-
1560 value.data->ref.load(), engineCacheCount.value(value.data),
dead code: QMessageLogger(__FILE__, 2832, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type());
-
1561 value.data->type());
dead code: QMessageLogger(__FILE__, 2832, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type());
-
1562}
never executed: end of block
0
1563-
1564void QFontCache::insertEngine(const Key &key, QFontEngine *engine, bool insertMulti)-
1565{-
1566 ((!(engine != nullptr)) ? qt_assert("engine != Q_NULLPTR",__FILE__,2841) : qt_noop());-
1567 ((!(key.multi == (engine->type() == QFontEngine::Multi))) ? qt_assert("key.multi == (engine->type() == QFontEngine::Multi)",__FILE__,2842) : qt_noop());-
1568 engine->ref.ref();-
1569-
1570 if (total_cost > min_cost * 2
total_cost > min_cost * 2Description
TRUEnever evaluated
FALSEnever evaluated
&& engineCache.size() >= 256
engineCache.size() >= 256Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1571 decreaseCache();
never executed: decreaseCache();
0
1572-
1573 Engine data(engine);-
1574 data.timestamp = ++current_timestamp;-
1575-
1576 if (insertMulti
insertMultiDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1577 engineCache.insertMulti(key, data);
never executed: engineCache.insertMulti(key, data);
0
1578 else-
1579 engineCache.insert(key, data);
never executed: engineCache.insert(key, data);
0
1580-
1581 if (++
++engineCacheC...t[engine] == 1Description
TRUEnever evaluated
FALSEnever evaluated
engineCacheCount[engine] == 1
++engineCacheC...t[engine] == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1582 increaseCost(engine->cache_cost);
never executed: increaseCost(engine->cache_cost);
0
1583}
never executed: end of block
0
1584-
1585void QFontCache::increaseCost(uint cost)-
1586{-
1587 cost = (cost + 512) / 1024;-
1588 cost = cost > 0
cost > 0Description
TRUEnever evaluated
FALSEnever evaluated
? cost : 1;
0
1589 total_cost += cost;-
1590-
1591 if (false) QMessageLogger(__FILE__, 2875, __PRETTY_FUNCTION__).debug(" COST: increased %u kb, total_cost %u kb, max_cost %u kb",
dead code: QMessageLogger(__FILE__, 2875, __PRETTY_FUNCTION__).debug(" COST: increased %u kb, total_cost %u kb, max_cost %u kb", cost, total_cost, max_cost);
-
1592 cost, total_cost, max_cost);
dead code: QMessageLogger(__FILE__, 2875, __PRETTY_FUNCTION__).debug(" COST: increased %u kb, total_cost %u kb, max_cost %u kb", cost, total_cost, max_cost);
-
1593-
1594 if (total_cost > max_cost
total_cost > max_costDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1595 max_cost = total_cost;-
1596-
1597 if (timer_id == -1
timer_id == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| ! fast
! fastDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1598 if (false) QMessageLogger(__FILE__, 2882, __PRETTY_FUNCTION__).debug(" TIMER: starting fast timer (%d ms)", fast_timeout);
dead code: QMessageLogger(__FILE__, 2882, __PRETTY_FUNCTION__).debug(" TIMER: starting fast timer (%d ms)", fast_timeout);
-
1599-
1600 if (timer_id != -1
timer_id != -1Description
TRUEnever evaluated
FALSEnever evaluated
) killTimer(timer_id);
never executed: killTimer(timer_id);
0
1601 timer_id = startTimer(fast_timeout);-
1602 fast = true;-
1603 }
never executed: end of block
0
1604 }
never executed: end of block
0
1605}
never executed: end of block
0
1606-
1607void QFontCache::decreaseCost(uint cost)-
1608{-
1609 cost = (cost + 512) / 1024;-
1610 cost = cost > 0
cost > 0Description
TRUEnever evaluated
FALSEnever evaluated
? cost : 1;
0
1611 ((!(cost <= total_cost)) ? qt_assert("cost <= total_cost",__FILE__,2895) : qt_noop());-
1612 total_cost -= cost;-
1613-
1614 if (false) QMessageLogger(__FILE__, 2898, __PRETTY_FUNCTION__).debug(" COST: decreased %u kb, total_cost %u kb, max_cost %u kb",
dead code: QMessageLogger(__FILE__, 2898, __PRETTY_FUNCTION__).debug(" COST: decreased %u kb, total_cost %u kb, max_cost %u kb", cost, total_cost, max_cost);
-
1615 cost, total_cost, max_cost);
dead code: QMessageLogger(__FILE__, 2898, __PRETTY_FUNCTION__).debug(" COST: decreased %u kb, total_cost %u kb, max_cost %u kb", cost, total_cost, max_cost);
-
1616}
never executed: end of block
0
1617-
1618void QFontCache::timerEvent(QTimerEvent *)-
1619{-
1620 if (false) QMessageLogger(__FILE__, 2904, __PRETTY_FUNCTION__).debug("QFontCache::timerEvent: performing cache maintenance (timestamp %u)",
dead code: QMessageLogger(__FILE__, 2904, __PRETTY_FUNCTION__).debug("QFontCache::timerEvent: performing cache maintenance (timestamp %u)", current_timestamp);
-
1621 current_timestamp);
dead code: QMessageLogger(__FILE__, 2904, __PRETTY_FUNCTION__).debug("QFontCache::timerEvent: performing cache maintenance (timestamp %u)", current_timestamp);
-
1622-
1623 if (total_cost <= max_cost
total_cost <= max_costDescription
TRUEnever evaluated
FALSEnever evaluated
&& max_cost <= min_cost
max_cost <= min_costDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1624 if (false) QMessageLogger(__FILE__, 2908, __PRETTY_FUNCTION__).debug(" cache redused sufficiently, stopping timer");
dead code: QMessageLogger(__FILE__, 2908, __PRETTY_FUNCTION__).debug(" cache redused sufficiently, stopping timer");
-
1625-
1626 killTimer(timer_id);-
1627 timer_id = -1;-
1628 fast = false;-
1629-
1630 return;
never executed: return;
0
1631 }-
1632 decreaseCache();-
1633}
never executed: end of block
0
1634-
1635void QFontCache::decreaseCache()-
1636{-
1637-
1638 uint in_use_cost = 0;-
1639-
1640 {-
1641 if (false) QMessageLogger(__FILE__, 2925, __PRETTY_FUNCTION__).debug(" SWEEP engine data:");
dead code: QMessageLogger(__FILE__, 2925, __PRETTY_FUNCTION__).debug(" SWEEP engine data:");
-
1642-
1643-
1644 const uint engine_data_cost =-
1645 sizeof(QFontEngineData) > 1024
sizeof(QFontEngineData) > 1024Description
TRUEnever evaluated
FALSEnever evaluated
? sizeof(QFontEngineData) : 1024;
0
1646-
1647 EngineDataCache::ConstIterator it = engineDataCache.constBegin(),-
1648 end = engineDataCache.constEnd();-
1649 for (; it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
1650 if (false) QMessageLogger(__FILE__, 2934, __PRETTY_FUNCTION__).debug(" %p: ref %2d", it.value(), int(it.value()->ref.load()));
dead code: QMessageLogger(__FILE__, 2934, __PRETTY_FUNCTION__).debug(" %p: ref %2d", it.value(), int(it.value()->ref.load()));
-
1651-
1652 if (it.value()->ref.load() != 1
it.value()->ref.load() != 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1653 in_use_cost += engine_data_cost;
never executed: in_use_cost += engine_data_cost;
0
1654 }
never executed: end of block
0
1655 }-
1656-
1657 {-
1658 if (false) QMessageLogger(__FILE__, 2942, __PRETTY_FUNCTION__).debug(" SWEEP engine:");
dead code: QMessageLogger(__FILE__, 2942, __PRETTY_FUNCTION__).debug(" SWEEP engine:");
-
1659-
1660 EngineCache::ConstIterator it = engineCache.constBegin(),-
1661 end = engineCache.constEnd();-
1662 for (; it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
1663 if (false) QMessageLogger(__FILE__, 2947, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes",
dead code: QMessageLogger(__FILE__, 2947, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->cache_cost);
-
1664 it.value().data, it.value().timestamp, it.value().hits,
dead code: QMessageLogger(__FILE__, 2947, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->cache_cost);
-
1665 it.value().data->ref.load(), engineCacheCount.value(it.value().data),
dead code: QMessageLogger(__FILE__, 2947, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->cache_cost);
-
1666 it.value().data->cache_cost);
dead code: QMessageLogger(__FILE__, 2947, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->cache_cost);
-
1667-
1668 if (it.value().data->ref.load() != 0
it.value().dat...ef.load() != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1669 in_use_cost += it.value().data->cache_cost / engineCacheCount.value(it.value().data);
never executed: in_use_cost += it.value().data->cache_cost / engineCacheCount.value(it.value().data);
0
1670 }
never executed: end of block
0
1671-
1672-
1673 in_use_cost += engineCache.size();-
1674 }-
1675-
1676 in_use_cost = (in_use_cost + 512) / 1024;-
1677 uint new_max_cost = qMax(qMax(max_cost / 2, in_use_cost), min_cost);-
1678-
1679 if (false) QMessageLogger(__FILE__, 2972, __PRETTY_FUNCTION__).debug(" after sweep, in use %u kb, total %u kb, max %u kb, new max %u kb",
dead code: QMessageLogger(__FILE__, 2972, __PRETTY_FUNCTION__).debug(" after sweep, in use %u kb, total %u kb, max %u kb, new max %u kb", in_use_cost, total_cost, max_cost, new_max_cost);
-
1680 in_use_cost, total_cost, max_cost, new_max_cost);
dead code: QMessageLogger(__FILE__, 2972, __PRETTY_FUNCTION__).debug(" after sweep, in use %u kb, total %u kb, max %u kb, new max %u kb", in_use_cost, total_cost, max_cost, new_max_cost);
-
1681-
1682 if (new_max_cost == max_cost
new_max_cost == max_costDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1683 if (fast
fastDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1684 if (false) QMessageLogger(__FILE__, 2977, __PRETTY_FUNCTION__).debug(" cannot shrink cache, slowing timer");
dead code: QMessageLogger(__FILE__, 2977, __PRETTY_FUNCTION__).debug(" cannot shrink cache, slowing timer");
-
1685-
1686 killTimer(timer_id);-
1687 timer_id = startTimer(slow_timeout);-
1688 fast = false;-
1689 }
never executed: end of block
0
1690-
1691 return;
never executed: return;
0
1692 } else if (! fast
! fastDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1693 if (false) QMessageLogger(__FILE__, 2986, __PRETTY_FUNCTION__).debug(" dropping into passing gear");
dead code: QMessageLogger(__FILE__, 2986, __PRETTY_FUNCTION__).debug(" dropping into passing gear");
-
1694-
1695 killTimer(timer_id);-
1696 timer_id = startTimer(fast_timeout);-
1697 fast = true;-
1698 }
never executed: end of block
0
1699-
1700 max_cost = new_max_cost;-
1701-
1702 {-
1703 if (false) QMessageLogger(__FILE__, 2996, __PRETTY_FUNCTION__).debug(" CLEAN engine data:");
dead code: QMessageLogger(__FILE__, 2996, __PRETTY_FUNCTION__).debug(" CLEAN engine data:");
-
1704-
1705-
1706 EngineDataCache::Iterator it = engineDataCache.begin();-
1707 while (it != engineDataCache.end()
it != engineDataCache.end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1708 if (it.value()->ref.load() == 1
it.value()->ref.load() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1709 if (false) QMessageLogger(__FILE__, 3002, __PRETTY_FUNCTION__).debug(" %p", it.value());
dead code: QMessageLogger(__FILE__, 3002, __PRETTY_FUNCTION__).debug(" %p", it.value());
-
1710 decreaseCost(sizeof(QFontEngineData));-
1711 it.value()->ref.deref();-
1712 delete it.value();-
1713 it = engineDataCache.erase(it);-
1714 }
never executed: end of block
else {
0
1715 ++it;-
1716 }
never executed: end of block
0
1717 }-
1718 }-
1719-
1720 if (false) QMessageLogger(__FILE__, 3013, __PRETTY_FUNCTION__).debug(" CLEAN engine:");
dead code: QMessageLogger(__FILE__, 3013, __PRETTY_FUNCTION__).debug(" CLEAN engine:");
-
1721-
1722-
1723 bool cost_decreased;-
1724 do {-
1725 cost_decreased = false;-
1726-
1727 EngineCache::Iterator it = engineCache.begin(),-
1728 end = engineCache.end();-
1729-
1730 uint oldest = ~0u;-
1731 uint least_popular = ~0u;-
1732-
1733 EngineCache::Iterator jt = end;-
1734-
1735 for ( ; it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
1736 if (it.value().data->ref.load() != engineCacheCount.value(it.value().data)
it.value().dat....value().data)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1737 continue;
never executed: continue;
0
1738-
1739 if (it.value().timestamp < oldest
it.value().timestamp < oldestDescription
TRUEnever evaluated
FALSEnever evaluated
&& it.value().hits <= least_popular
it.value().hit... least_popularDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1740 oldest = it.value().timestamp;-
1741 least_popular = it.value().hits;-
1742 jt = it;-
1743 }
never executed: end of block
0
1744 }
never executed: end of block
0
1745-
1746 it = jt;-
1747 if (it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1748 if (false) QMessageLogger(__FILE__, 3041, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d",
dead code: QMessageLogger(__FILE__, 3041, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->type());
-
1749 it.value().data, it.value().timestamp, it.value().hits,
dead code: QMessageLogger(__FILE__, 3041, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->type());
-
1750 it.value().data->ref.load(), engineCacheCount.value(it.value().data),
dead code: QMessageLogger(__FILE__, 3041, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->type());
-
1751 it.value().data->type());
dead code: QMessageLogger(__FILE__, 3041, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->type());
-
1752-
1753 QFontEngine *fontEngine = it.value().data;-
1754-
1755 it = engineCache.begin();-
1756 while (it != engineCache.end()
it != engineCache.end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1757 if (it.value().data == fontEngine
it.value().data == fontEngineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1758 fontEngine->ref.deref();-
1759 it = engineCache.erase(it);-
1760 }
never executed: end of block
else {
0
1761 ++it;-
1762 }
never executed: end of block
0
1763 }-
1764-
1765 ((!(fontEngine->ref.load() == 0)) ? qt_assert("fontEngine->ref.load() == 0",__FILE__,3058) : qt_noop());-
1766 decreaseCost(fontEngine->cache_cost);-
1767 delete fontEngine;-
1768 engineCacheCount.remove(fontEngine);-
1769-
1770 cost_decreased = true;-
1771 }
never executed: end of block
0
1772 }
never executed: end of block
while (cost_decreased
cost_decreasedDescription
TRUEnever evaluated
FALSEnever evaluated
&& total_cost > max_cost
total_cost > max_costDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
1773}
never executed: end of block
0
1774-
1775-
1776-
1777QDebug operator<<(QDebug stream, const QFont &font)-
1778{-
1779 return
never executed: return stream << "QFont(" << font.toString() << ')';
stream << "QFont(" << font.toString() << ')';
never executed: return stream << "QFont(" << font.toString() << ')';
0
1780}-
1781-
1782-
1783-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9