From 7a39e69a32297600507014915cade4161008e854 Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:03:55 +0100 Subject: [PATCH] element-name: if no name is set, set to "en" / "NoName" (also adjusted comment) --- sources/NameList/nameslist.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sources/NameList/nameslist.cpp b/sources/NameList/nameslist.cpp index 8117651ef..3e227823b 100644 --- a/sources/NameList/nameslist.cpp +++ b/sources/NameList/nameslist.cpp @@ -168,8 +168,13 @@ void NamesList::fromXml(const pugi::xml_node &xml_element, const QHash xml_opt = getXmlOptions(xml_options); QDomElement names_elmt = xml_document.createElement(xml_opt["ParentTagName"]); + if (hash_names.isEmpty()) { + QDomElement name_elmt = xml_document.createElement(xml_opt["TagName"]); + name_elmt.setAttribute(xml_opt["LanguageAttribute"], "en"); + name_elmt.appendChild(xml_document.createTextNode("NoName")); + names_elmt.appendChild(name_elmt); + } QHashIterator names_iterator(hash_names); while (names_iterator.hasNext()) { names_iterator.next();