diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index 9e24c4fc9d..11c68efd40 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -50,11 +50,11 @@ QT_USE_NAMESPACE #ifndef QT_NO_ACCESSIBILITY -static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &offset, NSUInteger *start = 0, NSUInteger *end = 0) +static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *offset, NSUInteger *start = 0, NSUInteger *end = 0) { - Q_ASSERT(line == -1 || offset == -1); - Q_ASSERT(line != -1 || offset != -1); - Q_ASSERT(offset <= text->characterCount()); + Q_ASSERT(*line == -1 || *offset == -1); + Q_ASSERT(*line != -1 || *offset != -1); + Q_ASSERT(*offset <= text->characterCount()); int curLine = -1; int curStart = 0, curEnd = 0; @@ -81,14 +81,14 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of if (nextEnd == curEnd) ++curEnd; } - } while ((line == -1 || curLine < line) && (offset == -1 || (curEnd <= offset)) && curEnd <= text->characterCount()); + } while ((*line == -1 || curLine < *line) && (*offset == -1 || (curEnd <= *offset)) && curEnd <= text->characterCount()); curEnd = qMin(curEnd, text->characterCount()); - if (line == -1) - line = curLine; - if (offset == -1) - offset = curStart; + if (*line == -1) + *line = curLine; + if (*offset == -1) + *offset = curStart; Q_ASSERT(curStart >= 0); Q_ASSERT(curEnd >= 0); @@ -346,7 +346,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of if (QAccessibleTextInterface *text = iface->textInterface()) { int line = -1; int position = text->cursorPosition(); - convertLineOffset(text, line, position); + convertLineOffset(text, &line, &position); return [NSNumber numberWithInt: line]; } return nil; @@ -405,7 +405,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of if (index < 0 || index > iface->textInterface()->characterCount()) return nil; int line = -1; - convertLineOffset(iface->textInterface(), line, index); + convertLineOffset(iface->textInterface(), &line, &index); return [NSNumber numberWithInt:line]; } if ([attribute isEqualToString: NSAccessibilityRangeForLineParameterizedAttribute]) { @@ -415,7 +415,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of int lineOffset = -1; NSUInteger startOffset = 0; NSUInteger endOffset = 0; - convertLineOffset(iface->textInterface(), line, lineOffset, &startOffset, &endOffset); + convertLineOffset(iface->textInterface(), &line, &lineOffset, &startOffset, &endOffset); return [NSValue valueWithRange:NSMakeRange(startOffset, endOffset - startOffset)]; } if ([attribute isEqualToString: NSAccessibilityBoundsForRangeParameterizedAttribute]) { |