summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2015-04-22 05:28:08 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2015-05-01 05:35:53 +0000
commit7443b3c9493ebed90397eaa4f3622e76e3131d10 (patch)
tree765768551cee490af28432fbb72a55c1dc7692b1 /src
parenta37daf99ad275d6e3e218504ec573f10fb18a48c (diff)
Optimize QFont::resolve(const QFont &other)
When resolve_mask is 0, the font inherits just everything, and there is no need in checking for any resolved attributes; the resolved font always inherits dpi, so do not check it either. Change-Id: Ie5d7ced0859d46a9237447e29051a22569480a51 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qfont.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index a5fade99fd..ce39645246 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -1724,10 +1724,8 @@ bool QFont::rawMode() const
*/
QFont QFont::resolve(const QFont &other) const
{
- if (*this == other
- && (resolve_mask == other.resolve_mask || resolve_mask == 0)
- && d->dpi == other.d->dpi) {
- QFont o = other;
+ if (resolve_mask == 0 || (resolve_mask == other.resolve_mask && *this == other)) {
+ QFont o(other);
o.resolve_mask = resolve_mask;
return o;
}