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.

Change-Id: I07c83cb051d87b33cc2d4f34078c50805c312ea6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit b949f65f60829e98d2c413080daa0e485936665c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Mårten Nordheim 2022-12-12 12:23:34 +01:00 committed by Qt Cherry-pick Bot
parent 39a47329a4
commit 70b6896a82

View File

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