QDom: Don't reuse a moved-from object

Code checker doesn't like that we simply assign to the moved-from
object's member, so create a separate object to be nice.

Pick-to: 6.5
Change-Id: I07c83cb051d87b33cc2d4f34078c50805c312ea6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Mårten Nordheim 2022-12-12 12:23:34 +01:00 committed by Giuseppe D'Angelo
parent 054ea5dfd5
commit b949f65f60

View File

@ -4080,10 +4080,11 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const
&& ((!value->ownerNode || value->ownerNode->prefix != value->prefix)
&& !outputtedPrefixes.hasSeen(value->prefix)))
{
attr.prefix = QStringLiteral("xmlns");
attr.name = value->prefix;
attr.encodedValue = encodeText(value->namespaceURI, true, true);
attributesToSave.push_back(std::move(attr));
SavedAttribute nsAttr;
nsAttr.prefix = QStringLiteral("xmlns");
nsAttr.name = value->prefix;
nsAttr.encodedValue = encodeText(value->namespaceURI, true, true);
attributesToSave.push_back(std::move(nsAttr));
}
}