From 328c0cf809a437a9875e485d2da12a2da22cd11b Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 15 Jun 2020 17:39:32 +0200 Subject: CppTool: Avoid a use of QStringRef Change-Id: I2a82bad7d91e059915526f0cf7b89f0d8367463a Reviewed-by: Christian Kandeler --- src/plugins/cppeditor/cpphighlighter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/cppeditor') diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index d862ea3c2c..6cfa94ee52 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -195,7 +195,7 @@ void CppHighlighter::highlightBlock(const QString &text) } else if (tk.isKeyword() || (m_languageFeatures.qtKeywordsEnabled - && CppTools::isQtKeyword(text.midRef(tk.utf16charsBegin(), tk.utf16chars()))) + && CppTools::isQtKeyword(QStringView{text}.mid(tk.utf16charsBegin(), tk.utf16chars()))) || (m_languageFeatures.objCEnabled && tk.isObjCAtKeyword())) { setFormat(tk.utf16charsBegin(), tk.utf16chars(), formatForCategory(C_KEYWORD)); } else if (tk.isPrimitiveType()) { -- cgit v1.2.1