diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-24 14:47:20 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-02-24 14:47:20 +0000 |
commit | b736151c2bb6c68f700d38274d740a6e0cf59a49 (patch) | |
tree | 83e110a7205757addba6e86a3c2367e4b52afa05 /src/gui/text/qtextlayout.cpp | |
parent | ff76300a5c9f209f625384f35ad0fdb0acebd799 (diff) | |
parent | 1fadc7292b66d4b3984bf5ef36c70b46b07a1c6b (diff) |
Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 9cc9cc9206..8902d52b28 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2147,6 +2147,7 @@ static QGlyphRun glyphRunWithInfo(QFontEngine *fontEngine, QGlyphRunPrivate *d = QGlyphRunPrivate::get(glyphRun); int rangeStart = textPosition; + logClusters += textPosition; while (*logClusters != glyphsStart && rangeStart < textPosition + textLength) { ++logClusters; ++rangeStart; @@ -2331,16 +2332,16 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const if (mainFontEngine->type() == QFontEngine::Multi) { QFontEngineMulti *multiFontEngine = static_cast<QFontEngineMulti *>(mainFontEngine); - int end = rtl ? glyphLayout.numGlyphs : 0; - int start = rtl ? end : 0; - int which = glyphLayout.glyphs[rtl ? start - 1 : end] >> 24; - for (; (rtl && start > 0) || (!rtl && end < glyphLayout.numGlyphs); + int start = rtl ? glyphLayout.numGlyphs : 0; + int end = start - 1; + int which = glyphLayout.glyphs[rtl ? start - 1 : end + 1] >> 24; + for (; (rtl && start > 0) || (!rtl && end < glyphLayout.numGlyphs - 1); rtl ? --start : ++end) { - const int e = glyphLayout.glyphs[rtl ? start - 1 : end] >> 24; + const int e = glyphLayout.glyphs[rtl ? start - 1 : end + 1] >> 24; if (e == which) continue; - QGlyphLayout subLayout = glyphLayout.mid(start, end - start); + QGlyphLayout subLayout = glyphLayout.mid(start, end - start + 1); multiFontEngine->ensureEngineAt(which); QGlyphRun::GlyphRunFlags subFlags = flags; @@ -2364,13 +2365,13 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const } if (rtl) - end = start; + end = start - 1; else - start = end; + start = end + 1; which = e; } - QGlyphLayout subLayout = glyphLayout.mid(start, end - start); + QGlyphLayout subLayout = glyphLayout.mid(start, end - start + 1); multiFontEngine->ensureEngineAt(which); QGlyphRun::GlyphRunFlags subFlags = flags; |