diff options
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; } |