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) if (wsm == QTextHtmlParserNode::WhiteSpacePre || wsm == QTextHtmlParserNode::WhiteSpacePreWrap)
compressNextWhitespace = PreserveWhiteSpace; compressNextWhitespace = PreserveWhiteSpace;
QString text = currentNode->text; const QString text = currentNode->text;
QString textToInsert; QString textToInsert;
textToInsert.reserve(text.size()); textToInsert.reserve(text.size());
for (int i = 0; i < text.size(); ++i) { for (QChar ch : text) {
QChar ch = text.at(i);
if (ch.isSpace() if (ch.isSpace()
&& ch != QChar::Nbsp && ch != QChar::Nbsp
&& ch != QChar::ParagraphSeparator) { && ch != QChar::ParagraphSeparator) {