Fix cursor position adjustment when removing strings
authorJiang Jiang <jiang.jiang@nokia.com>
Mon, 24 Jan 2011 18:09:38 +0000 (19:09 +0100)
committerJason McDonald <jason.mcdonald@nokia.com>
Wed, 26 Jan 2011 07:23:02 +0000 (17:23 +1000)
commit9b43b91a06b2ed454f0e715cfbbf7ab4de24c641
treed623487b86f69520b70d9eebc3f2608a949737bc
parent259ece8b7b78ebe6ef05ce140a83ebab284995a9
Fix cursor position adjustment when removing strings

Commit 0ba1b4d0 introduced a regression to QTextDocument: it postponed
cursor position adjustment until the move operation is done, but
contentsChanged will be triggered by finishEdit() in this move
operation, thus cursor positions in this signal handler will be in
inconsistent states (normally we should first update cursor position
then trigger contentsChanged). In this case we should also postpone
finishEdit() handling after cursor positions have been adjusted, then
the states expose to applications will be consistent.

Task-number: QTBUG-15857
Reviewed-by: Eskil
(cherry picked from commit 34c297faca93e1286573b2a01127e4e7af00aff2)
src/gui/text/qtextdocument_p.cpp
tests/auto/qtextcursor/tst_qtextcursor.cpp