summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-08-29 12:15:31 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-29 12:15:31 +0200
commit577b26b3178dfde697ca7ef969b180e9b8f4c08b (patch)
tree3ff992c108fa9f5653cb907f2eec3f2977bf8bdd /src/gui
parentbe62ece6c1ae8cbe19f1a445f82e55782fd22129 (diff)
parentd0c48efbae386dc88ea2313264e739715d9154b4 (diff)
Merge "Merge remote branch 'gerrit/master' into refactor" into refactor
Diffstat (limited to 'src/gui')
-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())