Return early if there is no text at the offset
Change-Id: I9d0b1e6e054a48bac34fb4e51b656c475f5638b4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>bb10
parent
08be8691f7
commit
95b1982e47
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue