QXmlStreamWriter: replace indexed with ranged for loops
Simpler, and fixes the int/qsizetype mismatches. Pick-to: 6.3 6.2 Task-number: QTBUG-102465 Change-Id: I8ac139a14c4c790348acd76b95d1bee83bb2797d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
ba741fd310
commit
2438551152
@ -2939,8 +2939,7 @@ void QXmlStreamWriterPrivate::writeEscaped(const QString &s, bool escapeWhitespa
|
||||
{
|
||||
QString escaped;
|
||||
escaped.reserve(s.size());
|
||||
for ( int i = 0; i < s.size(); ++i ) {
|
||||
QChar c = s.at(i);
|
||||
for (QChar c : s) {
|
||||
switch (c.unicode()) {
|
||||
case '<':
|
||||
escaped.append("<"_L1);
|
||||
@ -3718,9 +3717,8 @@ void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader)
|
||||
break;
|
||||
case QXmlStreamReader::StartElement: {
|
||||
writeStartElement(reader.namespaceUri().toString(), reader.name().toString());
|
||||
QXmlStreamNamespaceDeclarations namespaceDeclarations = reader.namespaceDeclarations();
|
||||
for (int i = 0; i < namespaceDeclarations.size(); ++i) {
|
||||
const QXmlStreamNamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.at(i);
|
||||
const QXmlStreamNamespaceDeclarations decls = reader.namespaceDeclarations();
|
||||
for (const auto &namespaceDeclaration : decls) {
|
||||
writeNamespace(namespaceDeclaration.namespaceUri().toString(),
|
||||
namespaceDeclaration.prefix().toString());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user