summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@theqtcompany.com>2015-10-23 09:20:21 +0200
committerAndy Shaw <andy.shaw@theqtcompany.com>2015-10-27 18:00:14 +0000
commit95b1982e4779160a42000661986a31aab6bafbb5 (patch)
tree144949de8ea51f5d4306127538fbbb507abc959c
parent08be8691f7ba5e522cbc000b1880941128ad5f8c (diff)
Return early if there is no text at the offset
Change-Id: I9d0b1e6e054a48bac34fb4e51b656c475f5638b4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm8
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