From 397a2680b4e7ce90a8e4f8a4617450adb5d5a37d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 22 Mar 2010 17:31:36 +0100 Subject: Make QStackTextEngine cheaper to construct Default-constructing the QFont member of QTextEngine meant getting the QApplication::font() which is a waste of time. Reviewed-by: Benjamin Poulain --- src/gui/text/qtextengine.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index b826588..f2d0654 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1299,10 +1299,10 @@ QTextEngine::QTextEngine() } QTextEngine::QTextEngine(const QString &str, const QFont &f) - : fnt(f) + : text(str), + fnt(f) { init(this); - text = str; } QTextEngine::~QTextEngine() @@ -2610,10 +2610,9 @@ void QTextEngine::resolveAdditionalFormats() const } QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f) - : _layoutData(string, _memory, MemSize) + : QTextEngine(string, f), + _layoutData(string, _memory, MemSize) { - fnt = f; - text = string; stackEngine = true; layoutData = &_layoutData; } -- cgit v0.12