summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-24 13:28:17 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-24 13:31:14 +0100
commit1fadc7292b66d4b3984bf5ef36c70b46b07a1c6b (patch)
tree7a54f6a2612dc469ddbc5afc2cc0010099b661fe /src/gui/text/qtextlayout.cpp
parentea711d0f59d6272f14b61cb2fd3dc1ede2cc1eb6 (diff)
parentd8e65d5756c937fc3d9be3e5c30b31914a437393 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/plugins/platforms/windows/qwindowsfontengine.cpp src/plugins/platforms/windows/qwindowsnativeimage.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I649b32b260ce0ed2d6a5089021daa0d6a8db85f7
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r--src/gui/text/qtextlayout.cpp19
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;