From 6f9c5c85ca37e1fd1203317d4ed31ac33c0f1124 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Sun, 21 Jan 2018 17:13:36 +0300 Subject: [PATCH] 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 Reviewed-by: Lars Knoll --- src/gui/text/qtextengine.cpp | 24 ++++++++++++++++++------ 1 file 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) { }