From 70b336f702004c2cac13c3d61f7e0d062da2dc15 Mon Sep 17 00:00:00 2001 From: drwho495 <70452450+drwho495@users.noreply.github.com> Date: Tue, 6 Jan 2026 09:36:19 -0600 Subject: [PATCH] TopoNaming: Improve ElementMapVersion definition. (#26691) This change makes the program only mark an object's ElementMapVersion with the "1" prefix if the object has a hasher AND an element map. --- src/App/ComplexGeoData.h | 2 +- src/App/PropertyGeo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App/ComplexGeoData.h b/src/App/ComplexGeoData.h index 2e19aa8f1e..cc6446d344 100644 --- a/src/App/ComplexGeoData.h +++ b/src/App/ComplexGeoData.h @@ -280,7 +280,7 @@ public: return _elementMap->setElementName(element, name, masterTag, sid, overwrite); } - bool hasElementMap() + bool hasElementMap() const { return _elementMap != nullptr; } diff --git a/src/App/PropertyGeo.cpp b/src/App/PropertyGeo.cpp index bfe6dfbbdf..b8f5989deb 100644 --- a/src/App/PropertyGeo.cpp +++ b/src/App/PropertyGeo.cpp @@ -1302,7 +1302,7 @@ std::string PropertyComplexGeoData::getElementMapVersion(bool) const } auto owner = freecad_cast(getContainer()); std::ostringstream ss; - if (owner && owner->getDocument() && owner->getDocument()->getStringHasher() == data->Hasher) { + if (owner && owner->getDocument() && data->hasElementMap() && data->getElementMapSize() && owner->getDocument()->getStringHasher() == data->Hasher) { ss << "1."; } else {