diff options
author | Andy Shaw <andy.shaw@theqtcompany.com> | 2015-10-23 09:20:21 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@theqtcompany.com> | 2015-10-27 18:00:14 +0000 |
commit | 95b1982e4779160a42000661986a31aab6bafbb5 (patch) | |
tree | 144949de8ea51f5d4306127538fbbb507abc959c /src/plugins/platforms | |
parent | 08be8691f7ba5e522cbc000b1880941128ad5f8c (diff) |
Return early if there is no text at the offset
Change-Id: I9d0b1e6e054a48bac34fb4e51b656c475f5638b4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index 84d60df3ef..6769f4ab0c 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -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 |