diff --git a/sources/properties/terminaldata.cpp b/sources/properties/terminaldata.cpp index 59a6f2ae2..b8f65cdcf 100644 --- a/sources/properties/terminaldata.cpp +++ b/sources/properties/terminaldata.cpp @@ -43,13 +43,18 @@ QDomElement TerminalData::toXml(QDomDocument &xml_document) const { QDomElement xml_element = xml_document.createElement("terminaldata"); - xml_element.appendChild(createXmlProperty(xml_document, "x", q->scenePos().x())); - xml_element.appendChild(createXmlProperty(xml_document, "y", q->scenePos().y())); + + // m_pos cannot be stored, because in the partterminal it will not be updated. + // In PartTerminal m_pos is the position of the dock, in Terminal m_pos is the second side of the terminal + // This is hold for legacy compability reason + xml_element.appendChild(createXmlProperty(xml_document, "x", m_pos.x())); + xml_element.appendChild(createXmlProperty(xml_document, "y", m_pos.y())); xml_element.appendChild(createXmlProperty(xml_document, "name", m_name)); xml_element.appendChild(createXmlProperty(xml_document, "orientation", orientationToString(m_orientation))); return(xml_element); } + bool TerminalData::fromXml (const QDomElement &xml_element) // RETURNS True { // lit la position de la borne diff --git a/sources/qetgraphicsitem/terminal.cpp b/sources/qetgraphicsitem/terminal.cpp index 01ced29ad..e4ca1d626 100644 --- a/sources/qetgraphicsitem/terminal.cpp +++ b/sources/qetgraphicsitem/terminal.cpp @@ -733,7 +733,11 @@ QDomElement Terminal::toXml(QDomDocument &doc) const { // store terminal data too! // Do not store terminal data in its own child + // Bad hack. The problem is that in the diagrams the terminal is described by the position and in the Collection by the dock. + QPointF tempPos = d->m_pos; + d->m_pos = dock_elmt_; QDomElement terminalDataElement = d->toXml(doc); + d->m_pos = tempPos; int childsCount = terminalDataElement.childNodes().count(); for (int i=0; i < childsCount; i++) {