diff options
author | Anton Kudryavtsev <anton.kudryavtsev@vk.team> | 2023-10-04 14:53:30 +0300 |
---|---|---|
committer | Anton Kudryavtsev <anton.kudryavtsev@vk.team> | 2023-10-05 22:08:45 +0300 |
commit | 0ccb8ab1db1ab7e49dd0d13e94484f83c5f8dd90 (patch) | |
tree | c31cfff2807aa133e3359fdbe53b5f6892307743 | |
parent | 33d606412d8c2dc9ad3c0129af5bc8a74ce650be (diff) |
qtextdocument: replace fromLatin1 with L1 literal
to reduce allocations
Change-Id: Ie6f734269c9e880ff208629a625c88f4841e9533
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index ea259873e2..06099ee3f7 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2374,11 +2374,14 @@ QString QTextHtmlExporter::toHtml(ExportMode mode) fragmentMarkers = (mode == ExportFragment); - html += QString::fromLatin1("<meta charset=\"utf-8\" />"); + html += "<meta charset=\"utf-8\" />"_L1; QString title = doc->metaInformation(QTextDocument::DocumentTitle); - if (!title.isEmpty()) - html += QString::fromLatin1("<title>") + title + QString::fromLatin1("</title>"); + if (!title.isEmpty()) { + html += "<title>"_L1; + html += title; + html += "</title>"_L1; + } html += "<style type=\"text/css\">\n"_L1; html += "p, li { white-space: pre-wrap; }\n"_L1; html += "hr { height: 1px; border-width: 0; }\n"_L1; @@ -3023,7 +3026,8 @@ void QTextHtmlExporter::emitBlock(const QTextBlock &block) html += u'"'; } - QString styleString = QString::fromLatin1("margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"); + QString styleString; + styleString += "margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"_L1; if (format.hasProperty(QTextFormat::ListIndent)) { styleString += " -qt-list-indent: "_L1; |