QAccessibleTextEdit: Using x coordinate for calculate character width

Merge-request: 1148
Task-number: QTBUG-18233
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
(cherry picked from commit 6cd51aeec11e7a70ba560c350274d5a4bd43c9b9)
This commit is contained in:
José Millán Soto 2011-03-20 19:19:32 +01:00 committed by Olivier Goffart
parent 3880eee2d0
commit ed8f1a09f8

View File

@ -1334,7 +1334,7 @@ QRect QAccessibleTextEdit::characterRect(int offset, CoordinateType coordType)
QRect r = edit->cursorRect(cursor);
if (cursor.movePosition(QTextCursor::NextCharacter)) {
r.setWidth(edit->cursorRect(cursor).y() - r.y());
r.setWidth(edit->cursorRect(cursor).x() - r.x());
} else {
// we don't know the width of the character - maybe because we're at document end
// in that case, IAccessible2 tells us to return the width of a default character