From b3fd46a225b2fd5349095b5f8daaaa8468ac3d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 4 Jan 2025 17:40:15 +0100 Subject: [PATCH] Only do the units conversion on specific point types --- src/map/IMG/lblfile.cpp | 4 ++-- src/map/IMG/rgnfile.cpp | 3 ++- src/map/IMG/style.h | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/map/IMG/lblfile.cpp b/src/map/IMG/lblfile.cpp index ec58c081..6b4d1640 100644 --- a/src/map/IMG/lblfile.cpp +++ b/src/map/IMG/lblfile.cpp @@ -150,7 +150,7 @@ Label LBLFile::str2label(const QVector &str, bool capitalize, bap->append(c); } - if (split >= 0) { + if (convert && split >= 0) { QByteArray num(ft2m(label.mid(split), &ok)); if (ok) { QByteArray name(label.left(split - 1)); @@ -208,7 +208,7 @@ Label LBLFile::label6b(const SubFile *file, Handle &fileHdl, quint32 size, for (int cpt = 0; cpt < 4; cpt++) { if (c[cpt] > 0x2f || (charset == Normal && c[cpt] == 0x1d)) { - if (split >= 0) { + if (convert && split >= 0) { QByteArray num(ft2m(label.mid(split), &ok)); if (ok) { QByteArray name(label.left(split - 1)); diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index 62815046..ef629710 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -516,7 +516,8 @@ bool RGNFile::pointObjects(Handle &hdl, const SubDiv *subdiv, if (lbl && (labelPtr & 0x3FFFFF)) point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF, labelPtr & 0x400000, !(Style::isCountry(point.type) - || Style::isState(point.type)), Style::isSpot(point.type)); + || Style::isState(point.type)), Style::isSpot(point.type) + || Style::isSummit(point.type)); point.id = pointId(pos, point.type, point.label.text()); points->append(point); diff --git a/src/map/IMG/style.h b/src/map/IMG/style.h index d08c70c1..88fae052 100644 --- a/src/map/IMG/style.h +++ b/src/map/IMG/style.h @@ -134,6 +134,8 @@ public: {return (type == TYPE(0x16) || type == 0x10a03);} static bool isSpot(quint32 type) {return (type == TYPE(0x62) || type == TYPE(0x63));} + static bool isSummit(quint32 type) + {return (type == 0x6616);} static bool isMajorRoad(quint32 type) {return (type <= TYPE(0x04));} static bool isCountry(quint32 type)