qtexthtmlparser: use tokenize instead of split
to avoid needless tmp list Change-Id: I5f6bc9c3edd17c04e5293feb0aad86cd5ed49695 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>bb10
parent
7cccbae61f
commit
b86b415337
|
|
@ -1594,10 +1594,9 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes)
|
|||
node->charFormat.setProperty(QTextFormat::FontSizeAdjustment, n);
|
||||
} else if (key == "face"_L1) {
|
||||
if (value.contains(u',')) {
|
||||
const QStringList values = value.split(u',');
|
||||
QStringList families;
|
||||
for (const QString &family : values)
|
||||
families << family.trimmed();
|
||||
for (auto family : value.tokenize(u','))
|
||||
families << family.trimmed().toString();
|
||||
node->charFormat.setFontFamilies(families);
|
||||
} else {
|
||||
node->charFormat.setFontFamilies(QStringList(value));
|
||||
|
|
|
|||
Loading…
Reference in New Issue