From 6111d8ca2ced60cd508cc821e9041335a56c7c4b Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Fri, 28 Feb 2025 21:08:12 +0100 Subject: [PATCH] only write author-information, if available --- sources/editor/elementscene.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sources/editor/elementscene.cpp b/sources/editor/elementscene.cpp index a9a64b65b..9c5f858b8 100644 --- a/sources/editor/elementscene.cpp +++ b/sources/editor/elementscene.cpp @@ -478,10 +478,12 @@ const QDomDocument ElementScene::toXml(bool all_parts) root.appendChild(element_info); } - //complementary information about the element - QDomElement informations_element = xml_document.createElement("informations"); - root.appendChild(informations_element); - informations_element.appendChild(xml_document.createTextNode(m_element_data.m_drawing_information.trimmed())); + //complementary information about the element, when available + if (!(m_element_data.m_drawing_information.trimmed().isEmpty())) { + QDomElement informations_element = xml_document.createElement("informations"); + root.appendChild(informations_element); + informations_element.appendChild(xml_document.createTextNode(m_element_data.m_drawing_information.trimmed())); + } QDomElement description = xml_document.createElement("description");