From d555e629b188bef2e007db1befea2e7e2f7da42e Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Fri, 9 Aug 2024 17:56:01 +0200 Subject: [PATCH] [gpx] Correctly export modified bookmark name Signed-off-by: Alexander Borsuk --- kml/serdes_gpx.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kml/serdes_gpx.cpp b/kml/serdes_gpx.cpp index 3a7226c817..38968beb91 100644 --- a/kml/serdes_gpx.cpp +++ b/kml/serdes_gpx.cpp @@ -412,8 +412,13 @@ void SaveBookmarkData(Writer & writer, BookmarkData const & bookmarkData) { auto const [lat, lon] = mercator::ToLatLon(bookmarkData.m_point); writer << "\n"; - if (auto const name = GetDefaultLanguage(bookmarkData.m_name)) - writer << kIndent2 << "" << name.value() << "\n"; + // If user customized the default bookmark name, it's saved in m_customName. + auto name = GetDefaultLanguage(bookmarkData.m_customName); + if (!name) + name = GetDefaultLanguage(bookmarkData.m_name); // Original POI name stored when bookmark was created. + if (name) + writer << kIndent2 << "" << *name << "\n"; + if (auto const description = GetDefaultLanguage(bookmarkData.m_description)) { writer << kIndent2 << "";