summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r--src/gui/text/qtextdocument.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index a3dbf455cf..75899dec80 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -94,7 +94,7 @@ bool Qt::mightBeRichText(const QString& text)
++start;
// skip a leading <?xml ... ?> as for example with xhtml
- if (text.mid(start, 5) == QLatin1String("<?xml")) {
+ if (text.midRef(start, 5).compare(QLatin1String("<?xml")) == 0) {
while (start < text.length()) {
if (text.at(start) == QLatin1Char('?')
&& start + 2 < text.length()
@@ -109,12 +109,12 @@ bool Qt::mightBeRichText(const QString& text)
++start;
}
- if (text.mid(start, 5).toLower() == QLatin1String("<!doc"))
+ if (text.midRef(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.mid(open+1,3) == QLatin1String("lt;"))
+ if (text.at(open) == QLatin1Char('&') && text.midRef(open + 1, 3) == QLatin1String("lt;"))
return true; // support desperate attempt of user to see <...>
++open;
}