Make sure cursor position doesn't exceed line end
authorJiang Jiang <jiang.jiang@nokia.com>
Mon, 19 Sep 2011 11:20:13 +0000 (13:20 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 23 Sep 2011 12:05:56 +0000 (14:05 +0200)
commit978671c47574edaf8c28369610937e964860e1a7
tree8f3d3743ebf6cae66b6f57bbc60c9fa5d9b76550
parent56b7ee1dae5bec070f2a31a94dcf4baf8c712bd0
Make sure cursor position doesn't exceed line end

If we have trailing spaces at the end of a line, cursor will disappear
because the position we returned exceeds line end, thus the widget
border. By limiting it within line.width we can make sure it always
visible, which is more consistent to the behavior in common platforms.

Reviewed-by: Eskil
(cherry picked from commit c750afe0e0f043389d30850070889946e4c6e8af)

Change-Id: Ifc60b718369639bbb6f5afb35c29a6eb0dccd219
Reviewed-on: http://codereview.qt-project.org/5458
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
src/gui/text/qtextlayout.cpp