summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-09-13 15:35:08 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-09-14 11:10:46 (GMT)
commit36045c4b68f7b3771d18da397590eee5ae4f3c6f (patch)
treea48d8422ad23434e1ec2186309025948e614f9fd /src/gui
parente453fce2731069dce993a94b0c2291307cc7806c (diff)
downloadQt-36045c4b68f7b3771d18da397590eee5ae4f3c6f.zip
Qt-36045c4b68f7b3771d18da397590eee5ae4f3c6f.tar.gz
Qt-36045c4b68f7b3771d18da397590eee5ae4f3c6f.tar.bz2
Do not put cursor at non-stop character positions
When moving cursors, non-stop positions are skipped, however certain input sequences can still lead us there. In such cases we should simply ignore those positions in cursorToX. Task-number: QTBUG-7076 Reviewed-by: Eskil
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextlayout.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 4595ef5..c92e15b 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2507,6 +2507,9 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
int pos = *cursorPos;
int itm;
+ const HB_CharAttributes *attributes = eng->attributes();
+ while (pos < line.from + line.length && !attributes[pos].charStop)
+ pos++;
if (pos == line.from + (int)line.length) {
// end of line ensure we have the last item on the line
itm = eng->findItem(pos-1);