diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2016-01-08 16:22:12 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2016-01-18 11:16:57 +0000 |
commit | bc81a28554a256563e7df8860d17f10a63e45a2b (patch) | |
tree | 0ff0bf3d851353f56a905c8de826cdfbe7f55586 | |
parent | 294111e25a4e3639a83a87f70ed33ac0b3985f33 (diff) |
Passing parameters to convertLineOffset by pointer instead of reference
This is aligned with our coding style and it should have been this way from
the start.
Change-Id: I23a00eb220dd9f17d9239c811b556885a2c0186a
Reviewed-by: Fredrik de Vibe <fredrik.devibe@theqtcompany.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
-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 b55393c7dc..608a7583c0 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -44,11 +44,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; @@ -75,14 +75,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); @@ -338,7 +338,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; @@ -397,7 +397,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]) { @@ -407,7 +407,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]) { |