diff options
Diffstat (limited to 'src/gui/text/qsyntaxhighlighter.cpp')
-rw-r--r-- | src/gui/text/qsyntaxhighlighter.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp index c377472439..6c1e2e74fc 100644 --- a/src/gui/text/qsyntaxhighlighter.cpp +++ b/src/gui/text/qsyntaxhighlighter.cpp @@ -66,7 +66,7 @@ void QSyntaxHighlighterPrivate::applyFormatChanges() QList<QTextLayout::FormatRange> ranges = layout->formats(); const int preeditAreaStart = layout->preeditAreaPosition(); - const int preeditAreaLength = layout->preeditAreaText().length(); + const int preeditAreaLength = layout->preeditAreaText().size(); if (preeditAreaLength != 0) { auto isOutsidePreeditArea = [=](const QTextLayout::FormatRange &range) { @@ -81,22 +81,22 @@ void QSyntaxHighlighterPrivate::applyFormatChanges() } int i = 0; - while (i < formatChanges.count()) { + while (i < formatChanges.size()) { QTextLayout::FormatRange r; - while (i < formatChanges.count() && formatChanges.at(i) == r.format) + while (i < formatChanges.size() && formatChanges.at(i) == r.format) ++i; - if (i == formatChanges.count()) + if (i == formatChanges.size()) break; r.start = i; r.format = formatChanges.at(i); - while (i < formatChanges.count() && formatChanges.at(i) == r.format) + while (i < formatChanges.size() && formatChanges.at(i) == r.format) ++i; - Q_ASSERT(i <= formatChanges.count()); + Q_ASSERT(i <= formatChanges.size()); r.length = i - r.start; if (preeditAreaLength != 0) { @@ -219,7 +219,7 @@ void QSyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block) an int value. If no state is set, the returned value is -1. You can designate any other value to identify any given state using the setCurrentBlockState() function. Once the state is set the - QTextBlock keeps that value until it is set set again or until the + QTextBlock keeps that value until it is set again or until the corresponding paragraph of text is deleted. For example, if you're writing a simple C++ syntax highlighter, @@ -403,10 +403,10 @@ void QSyntaxHighlighter::rehighlightBlock(const QTextBlock &block) void QSyntaxHighlighter::setFormat(int start, int count, const QTextCharFormat &format) { Q_D(QSyntaxHighlighter); - if (start < 0 || start >= d->formatChanges.count()) + if (start < 0 || start >= d->formatChanges.size()) return; - const int end = qMin(start + count, d->formatChanges.count()); + const int end = qMin(start + count, d->formatChanges.size()); for (int i = start; i < end; ++i) d->formatChanges[i] = format; } @@ -456,7 +456,7 @@ void QSyntaxHighlighter::setFormat(int start, int count, const QFont &font) QTextCharFormat QSyntaxHighlighter::format(int pos) const { Q_D(const QSyntaxHighlighter); - if (pos < 0 || pos >= d->formatChanges.count()) + if (pos < 0 || pos >= d->formatChanges.size()) return QTextCharFormat(); return d->formatChanges.at(pos); } |