diff options
author | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2022-12-12 12:23:34 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-12-14 11:41:53 +0000 |
commit | 70b6896a820cf96fed6dd49657bd0a7df9c35df2 (patch) | |
tree | b118c9f2e503bb8f5fd27d518c0638fcc07a59f8 | |
parent | 39a47329a43c4a0f9cddf694d3c6c597fbdf0065 (diff) |
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>
-rw-r--r-- | src/xml/dom/qdom.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 557f5c10b4..5928255778 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)); } } |