QTextDocumentFragment: use range for more

to improve readability

Change-Id: I42109e33fc076763c5b681d4837a81399c5aed5d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Anton Kudryavtsev 2024-03-12 13:46:33 +03:00
parent 1cd95e3165
commit ed553b720d

View File

@ -577,14 +577,12 @@ bool QTextHtmlImporter::appendNodeText()
if (wsm == QTextHtmlParserNode::WhiteSpacePre || wsm == QTextHtmlParserNode::WhiteSpacePreWrap)
compressNextWhitespace = PreserveWhiteSpace;
QString text = currentNode->text;
const QString text = currentNode->text;
QString textToInsert;
textToInsert.reserve(text.size());
for (int i = 0; i < text.size(); ++i) {
QChar ch = text.at(i);
for (QChar ch : text) {
if (ch.isSpace()
&& ch != QChar::Nbsp
&& ch != QChar::ParagraphSeparator) {