Utils: More porting.h related changes

Change-Id: I528a6950dfa6e09eb7f7ada265c8c41dba816bfd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2022-07-13 10:06:41 +02:00
parent 06023df8be
commit d842862944
55 changed files with 31 additions and 100 deletions

View File

@@ -27,10 +27,6 @@
#include <qmljs/qmljsscanner.h>
#include <utils/porting.h>
#include <QChar>
#include <QLatin1Char>
#include <QTextDocument>
#include <QTextCursor>
#include <QTextBlock>
@@ -175,7 +171,7 @@ bool AutoCompleter::contextAllowsAutoBrackets(const QTextCursor &cursor,
case Token::String: {
const QString blockText = cursor.block().text();
const QStringView tokenText = Utils::midView(blockText, token.offset, token.length);
const QStringView tokenText = QStringView(blockText).mid(token.offset, token.length);
QChar quote = tokenText.at(0);
// if a string literal doesn't start with a quote, it must be multiline
if (quote != QLatin1Char('"') && quote != QLatin1Char('\'')) {
@@ -219,7 +215,7 @@ bool AutoCompleter::contextAllowsAutoQuotes(const QTextCursor &cursor,
case Token::String: {
const QString blockText = cursor.block().text();
const QStringView tokenText = Utils::midView(blockText, token.offset, token.length);
const QStringView tokenText = QStringView(blockText).mid(token.offset, token.length);
QChar quote = tokenText.at(0);
// if a string literal doesn't start with a quote, it must be multiline
if (quote != QLatin1Char('"') && quote != QLatin1Char('\'')) {