diff options
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index bb44c19557..07aec6f019 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; } @@ -3135,7 +3135,7 @@ void QTextHtmlExporter::emitTable(const QTextTable *table) html += QLatin1String("</table>"); } -void QTextHtmlExporter::emitFrame(QTextFrame::Iterator frameIt) +void QTextHtmlExporter::emitFrame(const QTextFrame::Iterator &frameIt) { if (!frameIt.atEnd()) { QTextFrame::Iterator next = frameIt; |