diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-05-25 14:25:06 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-06-11 02:51:03 +0200 |
commit | d984adac68a70c0a23b411b103a4c8d777d6fb0d (patch) | |
tree | a519c261a12ef7cb98a3f29830ab53deb8cb9196 /src/gui/text/qtextdocument.cpp | |
parent | 82a0f4a193367fc661c95a832fbec74f8e9a76d1 (diff) |
Port QtGui from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I1761096fbcc9421a013cf73f831a2a2ba0c18006
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 25a18f56a9..04edf89430 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -102,7 +102,7 @@ bool Qt::mightBeRichText(const QString& text) ++start; // skip a leading <?xml ... ?> as for example with xhtml - if (text.midRef(start, 5).compare(QLatin1String("<?xml")) == 0) { + if (QStringView{text}.mid(start, 5).compare(QLatin1String("<?xml")) == 0) { while (start < text.length()) { if (text.at(start) == QLatin1Char('?') && start + 2 < text.length() @@ -117,12 +117,12 @@ bool Qt::mightBeRichText(const QString& text) ++start; } - if (text.midRef(start, 5).compare(QLatin1String("<!doc"), Qt::CaseInsensitive) == 0) + if (QStringView{text}.mid(start, 5).compare(QLatin1String("<!doc"), Qt::CaseInsensitive) == 0) return true; int open = start; while (open < text.length() && text.at(open) != QLatin1Char('<') && text.at(open) != QLatin1Char('\n')) { - if (text.at(open) == QLatin1Char('&') && text.midRef(open + 1, 3) == QLatin1String("lt;")) + if (text.at(open) == QLatin1Char('&') && QStringView{text}.mid(open + 1, 3) == QLatin1String("lt;")) return true; // support desperate attempt of user to see <...> ++open; } |