Return early if there is no text at the offset

Change-Id: I9d0b1e6e054a48bac34fb4e51b656c475f5638b4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
bb10
Andy Shaw 2015-10-23 09:20:21 +02:00
parent 08be8691f7
commit 95b1982e47
1 changed files with 8 additions and 0 deletions

View File

@ -54,6 +54,14 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of
do {
curStart = curEnd;
text->textAtOffset(curStart, QAccessible::LineBoundary, &curStart, &curEnd);
// If the text is empty then we just return
if (curStart == -1 || curEnd == -1) {
if (start)
*start = 0;
if (end)
*end = 0;
return;
}
++curLine;
{
// check for a case where a single word longer than the text edit's width and gets wrapped