revert saving title block properties in it's own child, because it makes more sense directly in the diagram

This commit is contained in:
Martin Marmsoler
2020-09-28 16:29:09 +02:00
parent 48cce42cfe
commit adc28d32b9
6 changed files with 33 additions and 33 deletions

View File

@@ -168,7 +168,7 @@ QRectF BorderTitleBlock::insideBorderRect() const
Exports the title block current values to XML.
@param xml_elmt the XML element attributes will be added to
*/
void BorderTitleBlock::titleBlockToXml(QDomDocument& doc) {
void BorderTitleBlock::titleBlockToXml(QDomElement& doc) {
exportTitleBlock().toXml(doc);
}

View File

@@ -152,7 +152,7 @@ class BorderTitleBlock : public QObject
void setPreviousFolioNum(const QString &previous);
void setNextFolioNum(const QString &next);
void titleBlockToXml(QDomDocument &doc);
void titleBlockToXml(QDomElement &doc);
void titleBlockFromXml(const QDomElement &);
void borderToXml(QDomElement &);
void borderFromXml(const QDomElement &);

View File

@@ -625,7 +625,7 @@ QDomDocument Diagram::toXml(bool whole_content) {
// proprietes du schema
if (whole_content) {
// TODO: compare with old version
border_and_titleblock.titleBlockToXml(document);
border_and_titleblock.titleBlockToXml(dom_root);
border_and_titleblock.borderToXml(dom_root);
// Default conductor properties

View File

@@ -999,7 +999,7 @@ QDomElement Conductor::toXml(QDomDocument & doc) const {
foreach(ConductorSegment *segment, segmentsList())
{
current_segment = doc.createElement("segment");
current_segment.appendChild(createXmlProperty(doc, "orientation", segment->isHorizontal()));
current_segment.appendChild(createXmlProperty(doc, "orientation", segment->isHorizontal() ? "horizontal": "vertical"));
current_segment.appendChild(createXmlProperty(doc, "length", segment -> length()));
dom_element.appendChild(current_segment);
}

View File

@@ -69,27 +69,23 @@ bool TitleBlockProperties::operator!=(const TitleBlockProperties &ip) {
Exporte le cartouche sous formes d'attributs XML ajoutes a l'element e.
@param e Element XML auquel seront ajoutes des attributs
*/
QDomElement TitleBlockProperties::toXml(QDomDocument &xml_document) const {
QDomElement e = xml_document.createElement("inset");
e.appendChild(createXmlProperty(xml_document, "author", author));
e.appendChild(createXmlProperty(xml_document, "title", title));
e.appendChild(createXmlProperty(xml_document, "filename", filename));
e.appendChild(createXmlProperty(xml_document, "plant", plant));
e.appendChild(createXmlProperty(xml_document, "locmach", locmach));
e.appendChild(createXmlProperty(xml_document, "indexrev", indexrev));
e.appendChild(createXmlProperty(xml_document, "version", version));
e.appendChild(createXmlProperty(xml_document, "folio", folio));
e.appendChild(createXmlProperty(xml_document, "auto_page_num", auto_page_num));
e.appendChild(createXmlProperty(xml_document, "date", exportDate()));
QString disp_at = display_at == Qt::BottomEdge? "bottom" : "right";
e.appendChild(createXmlProperty(xml_document, "displayAt", disp_at));
void TitleBlockProperties::toXml(QDomElement &e) const {
e.setAttribute("author", author);
e.setAttribute("title", title);
e.setAttribute("filename", filename);
e.setAttribute("plant", plant);
e.setAttribute("locmach", locmach);
e.setAttribute("indexrev",indexrev);
e.setAttribute("version", version);
e.setAttribute("folio", folio);
e.setAttribute("auto_page_num", auto_page_num);
e.setAttribute("date", exportDate());
e.setAttribute("displayAt", (display_at == Qt::BottomEdge? "bottom" : "right"));
if (!template_name.isEmpty())
{
e.appendChild(createXmlProperty(xml_document, "titleblocktemplate", template_name));
e.appendChild(createXmlProperty(xml_document, "titleblocktemplateCollection", QET::qetCollectionToString(collection)));
e.setAttribute("titleblocktemplate", template_name);
e.setAttribute("titleblocktemplateCollection", QET::qetCollectionToString(collection));
}
if (context.keys().count()) {
@@ -97,8 +93,11 @@ QDomElement TitleBlockProperties::toXml(QDomDocument &xml_document) const {
context.toXml(properties);
e.appendChild(properties);
}
}
return e;
QDomElement TitleBlockProperties::toXml(QDomDocument &d) const {
qDebug() << "NOT IMPLEMENTED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
return QDomElement();
}
/** RETURNS True

View File

@@ -41,7 +41,8 @@ class TitleBlockProperties: public PropertiesInterface {
bool operator==(const TitleBlockProperties &);
bool operator!=(const TitleBlockProperties &);
QDomElement toXml(QDomDocument &xml_document) const override;
QDomElement toXml(QDomDocument &e) const override;
void toXml(QDomElement &e) const;
bool fromXml(const QDomElement &) override;
void toSettings(QSettings &, const QString & = QString()) const override;
void fromSettings(const QSettings &, const QString & = QString()) override;