From ccaa56e34a2e602cbe3585a4e318e9f10c4002b7 Mon Sep 17 00:00:00 2001
From: Mikhail Svechnikov <m.svechnikov@fz-juelich.de>
Date: Tue, 29 Nov 2022 15:43:53 +0100
Subject: [PATCH] VectorProperty: use Tag namespace for serialization

---
 GUI/Model/Descriptor/VectorProperty.cpp | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/GUI/Model/Descriptor/VectorProperty.cpp b/GUI/Model/Descriptor/VectorProperty.cpp
index b073678812b..e823a19d611 100644
--- a/GUI/Model/Descriptor/VectorProperty.cpp
+++ b/GUI/Model/Descriptor/VectorProperty.cpp
@@ -17,6 +17,16 @@
 #include "GUI/Support/XML/UtilXML.h"
 #include <QUuid>
 
+namespace {
+namespace Tag {
+
+const QString X("X");
+const QString Y("Y");
+const QString Z("Z");
+
+} // namespace Tag
+} // namespace
+
 using std::variant;
 
 void VectorProperty::init(const QString& label, const QString& tooltip,
@@ -55,16 +65,16 @@ void VectorProperty::rwProperty(Streamer& s, const QString& tag)
 {
     if (QXmlStreamWriter* w = s.xmlWriter()) {
         w->writeStartElement(tag);
-        Serialize::rwProperty(s, "X", m_x);
-        Serialize::rwProperty(s, "Y", m_y);
-        Serialize::rwProperty(s, "Z", m_z);
+        Serialize::rwProperty(s, Tag::X, m_x);
+        Serialize::rwProperty(s, Tag::Y, m_y);
+        Serialize::rwProperty(s, Tag::Z, m_z);
         w->writeEndElement();
     } else if (QXmlStreamReader* r = s.xmlReader()) {
         r->readNextStartElement();
         s.assertCurrentTag(tag);
-        Serialize::rwProperty(s, "X", m_x);
-        Serialize::rwProperty(s, "Y", m_y);
-        Serialize::rwProperty(s, "Z", m_z);
+        Serialize::rwProperty(s, Tag::X, m_x);
+        Serialize::rwProperty(s, Tag::Y, m_y);
+        Serialize::rwProperty(s, Tag::Z, m_z);
         s.gotoEndElementOfTag(tag);
     } else
         ASSERT(0);
-- 
GitLab