QTextDocument: use QL1S::size() to get size of internal string
... instead of call of qstrlen(), because of ctor of QL1S already do this work for us. The old code is Qt4 legacy. Change-Id: I449ce7ea481af0efeade258d2cd5652db1f1a8b1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>bb10
parent
6030e63037
commit
f046205526
|
|
@ -2430,7 +2430,7 @@ bool QTextHtmlExporter::emitCharFormatStyle(const QTextCharFormat &format)
|
|||
html += QLatin1Char(';');
|
||||
attributesEmitted = true;
|
||||
} else {
|
||||
html.chop(qstrlen(decorationTag.latin1()));
|
||||
html.chop(decorationTag.size());
|
||||
}
|
||||
|
||||
if (format.foreground() != defaultCharFormat.foreground()
|
||||
|
|
@ -2665,7 +2665,7 @@ void QTextHtmlExporter::emitFragment(const QTextFragment &fragment)
|
|||
if (attributesEmitted)
|
||||
html += QLatin1String("\">");
|
||||
else
|
||||
html.chop(qstrlen(styleTag.latin1()));
|
||||
html.chop(styleTag.size());
|
||||
|
||||
if (isObject) {
|
||||
for (int i = 0; isImage && i < txt.length(); ++i) {
|
||||
|
|
@ -3227,7 +3227,7 @@ void QTextHtmlExporter::emitFrameStyle(const QTextFrameFormat &format, FrameType
|
|||
QString::number(format.rightMargin()));
|
||||
|
||||
if (html.length() == originalHtmlLength) // nothing emitted?
|
||||
html.chop(qstrlen(styleAttribute.latin1()));
|
||||
html.chop(styleAttribute.size());
|
||||
else
|
||||
html += QLatin1Char('\"');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue