summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAnton Kudryavtsev <anton.kudryavtsev@corp.mail.ru>2018-01-21 17:13:36 +0300
committerAnton Kudryavtsev <antkudr@mail.ru>2018-01-22 08:20:13 +0000
commit6f9c5c85ca37e1fd1203317d4ed31ac33c0f1124 (patch)
tree31039a552db906846b50b49f9fc19f2c12c83363 /src/gui
parent4d898a73e63e69e63bcb2c26ca15da595d7efb7a (diff)
QTextItemInt: replace 0 with nullptr
While touching the code, move initialization from body of ctor to initializer list Change-Id: Idfcb4fb771d1414268f8685874395ca54b20621a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextengine.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 71f02376ac..c88daed8d8 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -3510,19 +3510,31 @@ QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f)
}
QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format)
- : justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format),
- num_chars(0), chars(0), logClusters(0), f(0), fontEngine(0)
+ : justified(false),
+ underlineStyle(QTextCharFormat::NoUnderline),
+ charFormat(format),
+ num_chars(0),
+ chars(nullptr),
+ logClusters(nullptr),
+ f(font),
+ fontEngine(font->d->engineForScript(si.analysis.script))
{
- f = font;
- fontEngine = f->d->engineForScript(si.analysis.script);
Q_ASSERT(fontEngine);
initWithScriptItem(si);
}
QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format)
- : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format),
- num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe)
+ : flags(0),
+ justified(false),
+ underlineStyle(QTextCharFormat::NoUnderline),
+ charFormat(format),
+ num_chars(numChars),
+ chars(chars_),
+ logClusters(nullptr),
+ f(font),
+ glyphs(g),
+ fontEngine(fe)
{
}