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

@@ -25,8 +25,6 @@
#include "qmljscodeformatter.h"
#include <utils/porting.h>
#include <QLoggingCategory>
#include <QMetaEnum>
#include <QTextBlock>
@@ -229,7 +227,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
break;
case property_list_open: {
const QStringView tok = Utils::midView(m_currentLine,
const QStringView tok = QStringView(m_currentLine).mid(
m_currentToken.begin(),
m_currentToken.length);
if (tok == QLatin1String(">"))
@@ -876,7 +874,7 @@ int CodeFormatter::column(int index) const
QStringView CodeFormatter::currentTokenText() const
{
return Utils::midView(m_currentLine, m_currentToken.begin(), m_currentToken.length);
return QStringView(m_currentLine).mid(m_currentToken.begin(), m_currentToken.length);
}
void CodeFormatter::turnInto(int newState)
@@ -950,7 +948,7 @@ int CodeFormatter::tokenizeBlock(const QTextBlock &block)
CodeFormatter::TokenKind CodeFormatter::extendedTokenKind(const QmlJS::Token &token) const
{
const int kind = token.kind;
const QStringView text = Utils::midView(m_currentLine, token.begin(), token.length);
const QStringView text = QStringView(m_currentLine).mid(token.begin(), token.length);
if (kind == Identifier) {
if (text == QLatin1String("as"))