QFont: remove unused member QFontPrivate::screen

QFontPrivate::screen was not used anywhere so remove it.

Change-Id: Ie9381d08b59b93c4e7bcaad58ebf1b389aa0a2e6
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
Christian Ehrlicher 2019-08-17 14:13:50 +02:00
parent c8c724a3ce
commit 62015adadd
3 changed files with 8 additions and 18 deletions

View File

@ -180,14 +180,14 @@ Q_GUI_EXPORT int qt_defaultDpi()
} }
QFontPrivate::QFontPrivate() QFontPrivate::QFontPrivate()
: engineData(0), dpi(qt_defaultDpi()), screen(0), : engineData(0), dpi(qt_defaultDpi()),
underline(false), overline(false), strikeOut(false), kerning(true), underline(false), overline(false), strikeOut(false), kerning(true),
capital(0), letterSpacingIsAbsolute(false), scFont(0) capital(0), letterSpacingIsAbsolute(false), scFont(0)
{ {
} }
QFontPrivate::QFontPrivate(const QFontPrivate &other) QFontPrivate::QFontPrivate(const QFontPrivate &other)
: request(other.request), engineData(0), dpi(other.dpi), screen(other.screen), : request(other.request), engineData(0), dpi(other.dpi),
underline(other.underline), overline(other.overline), underline(other.underline), overline(other.overline),
strikeOut(other.strikeOut), kerning(other.kerning), strikeOut(other.strikeOut), kerning(other.kerning),
capital(other.capital), letterSpacingIsAbsolute(other.letterSpacingIsAbsolute), capital(other.capital), letterSpacingIsAbsolute(other.letterSpacingIsAbsolute),
@ -581,11 +581,9 @@ QFont::QFont(const QFont &font, const QPaintDevice *pd)
{ {
Q_ASSERT(pd); Q_ASSERT(pd);
const int dpi = pd->logicalDpiY(); const int dpi = pd->logicalDpiY();
const int screen = 0; if (font.d->dpi != dpi) {
if (font.d->dpi != dpi || font.d->screen != screen ) {
d = new QFontPrivate(*font.d); d = new QFontPrivate(*font.d);
d->dpi = dpi; d->dpi = dpi;
d->screen = screen;
} else { } else {
d = font.d; d = font.d;
} }

View File

@ -185,7 +185,6 @@ public:
QFontDef request; QFontDef request;
mutable QFontEngineData *engineData; mutable QFontEngineData *engineData;
int dpi; int dpi;
int screen;
uint underline : 1; uint underline : 1;
uint overline : 1; uint overline : 1;
@ -230,19 +229,17 @@ public:
void clear(); void clear();
struct Key { struct Key {
Key() : script(0), multi(0), screen(0) { } Key() : script(0), multi(0) { }
Key(const QFontDef &d, uchar c, bool m = 0, uchar s = 0) Key(const QFontDef &d, uchar c, bool m = 0)
: def(d), script(c), multi(m), screen(s) { } : def(d), script(c), multi(m) { }
QFontDef def; QFontDef def;
uchar script; uchar script;
uchar multi: 1; uchar multi: 1;
uchar screen: 7;
inline bool operator<(const Key &other) const inline bool operator<(const Key &other) const
{ {
if (script != other.script) return script < other.script; if (script != other.script) return script < other.script;
if (screen != other.screen) return screen < other.screen;
if (multi != other.multi) return multi < other.multi; if (multi != other.multi) return multi < other.multi;
if (multi && def.fallBackFamilies.size() != other.def.fallBackFamilies.size()) if (multi && def.fallBackFamilies.size() != other.def.fallBackFamilies.size())
return def.fallBackFamilies.size() < other.def.fallBackFamilies.size(); return def.fallBackFamilies.size() < other.def.fallBackFamilies.size();
@ -251,7 +248,6 @@ public:
inline bool operator==(const Key &other) const inline bool operator==(const Key &other) const
{ {
return script == other.script return script == other.script
&& screen == other.screen
&& multi == other.multi && multi == other.multi
&& (!multi || def.fallBackFamilies == other.def.fallBackFamilies) && (!multi || def.fallBackFamilies == other.def.fallBackFamilies)
&& def == other.def; && def == other.def;

View File

@ -185,11 +185,9 @@ QFontMetrics::QFontMetrics(const QFont &font, const QPaintDevice *paintdevice)
#endif #endif
{ {
const int dpi = paintdevice ? paintdevice->logicalDpiY() : qt_defaultDpi(); const int dpi = paintdevice ? paintdevice->logicalDpiY() : qt_defaultDpi();
const int screen = 0; if (font.d->dpi != dpi) {
if (font.d->dpi != dpi || font.d->screen != screen ) {
d = new QFontPrivate(*font.d); d = new QFontPrivate(*font.d);
d->dpi = dpi; d->dpi = dpi;
d->screen = screen;
} else { } else {
d = font.d; d = font.d;
} }
@ -1171,11 +1169,9 @@ QFontMetricsF::QFontMetricsF(const QFont &font, const QPaintDevice *paintdevice)
#endif #endif
{ {
int dpi = paintdevice ? paintdevice->logicalDpiY() : qt_defaultDpi(); int dpi = paintdevice ? paintdevice->logicalDpiY() : qt_defaultDpi();
const int screen = 0; if (font.d->dpi != dpi) {
if (font.d->dpi != dpi || font.d->screen != screen ) {
d = new QFontPrivate(*font.d); d = new QFontPrivate(*font.d);
d->dpi = dpi; d->dpi = dpi;
d->screen = screen;
} else { } else {
d = font.d; d = font.d;
} }