mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Fix problem that not all childs were added to the xml document
This commit is contained in:
@@ -75,7 +75,7 @@ QDomElement PartTerminal::toXml(QDomDocument &xml_document) const {
|
||||
// Do not store terminal data in its own child
|
||||
QDomElement terminalDataElement = d->toXml(xml_document);
|
||||
for (int i=0; i < terminalDataElement.childNodes().length(); i++) {
|
||||
qdo.appendChild(terminalDataElement.childNodes().at(i));
|
||||
qdo.appendChild(terminalDataElement.childNodes().at(i).cloneNode()); // cloneNode() is important, otherwise no deep clone is made
|
||||
}
|
||||
|
||||
return qdo;
|
||||
|
||||
@@ -734,9 +734,11 @@ QDomElement Terminal::toXml(QDomDocument &doc) const {
|
||||
|
||||
// Do not store terminal data in its own child
|
||||
QDomElement terminalDataElement = d->toXml(doc);
|
||||
int y = terminalDataElement.().length(); // TODO: seems to be not correct!
|
||||
for (int i=0; i < terminalDataElement.childNodes().length(); i++) {
|
||||
qdo.appendChild(terminalDataElement.childNodes().at(i));
|
||||
|
||||
int childsCount = terminalDataElement.childNodes().count();
|
||||
for (int i=0; i < childsCount; i++) {
|
||||
QDomNode node = terminalDataElement.childNodes().at(i).cloneNode(); // cloneNode() is important, otherwise no deep clone is made
|
||||
qdo.appendChild(node);
|
||||
}
|
||||
|
||||
return(qdo);
|
||||
|
||||
Reference in New Issue
Block a user