summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-08-29 12:11:53 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-08-29 12:11:53 +0200
commitd0c48efbae386dc88ea2313264e739715d9154b4 (patch)
tree97a30a0c58c8ecb8a9a58ae892f53c6e9efe03d7 /src/gui/text
parente35a83b293e6b38f6060895262b5494d36515e6e (diff)
parentd7305c10948f501450b6b3358d261217d13c6d6e (diff)
Merge remote branch 'gerrit/master' into refactor
Conflicts: src/gui/accessible/qaccessible.h src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication.h src/gui/kernel/qapplication_mac.mm src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qapplication_s60.cpp src/gui/kernel/qapplication_win.cpp src/gui/kernel/qapplication_x11.cpp src/gui/kernel/qdnd_x11.cpp src/gui/kernel/qwidget.cpp src/gui/widgets/qlabel.cpp Change-Id: Ief9c75724d2cff89ed45f009bdee2ffc5e4395ba
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontengine_p.h5
-rw-r--r--src/gui/text/qtextengine.cpp3
-rw-r--r--src/gui/text/qtextlayout.cpp2
3 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index b32e6916f0..a5858ffc7d 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -438,6 +438,11 @@ public:
QFontEngine *engine(int at) const
{Q_ASSERT(at < engines.size()); return engines.at(at); }
+ inline void ensureEngineAt(int at)
+ {
+ if (at >= engines.size() || engines.at(at) == 0)
+ loadEngine(at);
+ }
protected:
friend class QPSPrintEnginePrivate;
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 58cccfcbf7..95a797439a 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2093,7 +2093,8 @@ void QTextEngine::justify(const QScriptLine &line)
}
}
- QFixed need = line.width - line.textWidth;
+ QFixed leading = leadingSpaceWidth(line);
+ QFixed need = line.width - line.textWidth - leading;
if (need < 0) {
// line overflows already!
const_cast<QScriptLine &>(line).justified = true;
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 25d7de827e..5539acffd7 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2303,6 +2303,7 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
continue;
QGlyphLayout subLayout = glyphLayout.mid(start, end - start);
+ multiFontEngine->ensureEngineAt(which);
glyphRuns.append(glyphRunWithInfo(multiFontEngine->engine(which),
subLayout, pos, flags, x, width));
for (int i = 0; i < subLayout.numGlyphs; i++) {
@@ -2315,6 +2316,7 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
}
QGlyphLayout subLayout = glyphLayout.mid(start, end - start);
+ multiFontEngine->ensureEngineAt(which);
QGlyphRun glyphRun = glyphRunWithInfo(multiFontEngine->engine(which),
subLayout, pos, flags, x, width);
if (!glyphRun.isEmpty())