From a2baa830c5c6de61bedbc8bc314641a3efa45475 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Tue, 5 Apr 2016 19:32:19 +0200
Subject: [PATCH] [GL/IO] Add names to polylines.

---
 GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp
index 3c34a129161..78c370524c3 100644
--- a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp
+++ b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp
@@ -331,8 +331,12 @@ bool XmlGmlInterface::write()
                     polylineTag.setAttribute("id", QString::number(i));
 
                     std::string ply_name("");
-                    if (ply_vec->getNameOfElementByID(i, ply_name))
+                    if (ply_vec->getNameOfElementByID(i, ply_name)) {
                         polylineTag.setAttribute("name", QString::fromStdString(ply_name));
+                    } else {
+                        ply_name = std::to_string(i);
+                        polylineTag.setAttribute("name", QString::fromStdString(ply_name));
+                    }
 
                     plyListTag.appendChild(polylineTag);
 
-- 
GitLab