diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-09-13 17:35:08 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-04 01:54:33 +0100 |
commit | c30ebdeac028a3fe4a820cd5fe8360d11d14868d (patch) | |
tree | 80578d8757369499060d1764c0653af121606969 /src/gui/text/qtextlayout.cpp | |
parent | 75a2b9eef203b20584b4d0ac1589b4a3398afe08 (diff) |
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
Change-Id: Ia0a25931f4043359f72a6c0c14a74b905e40b93e
Reviewed-by: Eskil
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 4e7398e978..f2622a7b20 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2549,6 +2549,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); |