From 70b6896a820cf96fed6dd49657bd0a7df9c35df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 12 Dec 2022 12:23:34 +0100 Subject: [PATCH] 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 (cherry picked from commit b949f65f60829e98d2c413080daa0e485936665c) Reviewed-by: Qt Cherry-pick Bot --- src/xml/dom/qdom.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 557f5c10b4b..59282557782 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -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)); } }