diff options
author | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2022-12-12 12:23:34 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2022-12-14 00:22:18 +0000 |
commit | b949f65f60829e98d2c413080daa0e485936665c (patch) | |
tree | a5473d09e6f6a66b47481d8924173970adc149a1 /src/xml | |
parent | 054ea5dfd57617e5faa5940b9aadd25cdc247b49 (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.
Pick-to: 6.5
Change-Id: I07c83cb051d87b33cc2d4f34078c50805c312ea6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/xml')
-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)); } } |