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.
This commit is contained in:
drwho495
2026-01-06 09:36:19 -06:00
committed by GitHub
parent ede7013f55
commit 9b64da827a
2 changed files with 2 additions and 2 deletions

View File

@@ -280,7 +280,7 @@ public:
return _elementMap->setElementName(element, name, masterTag, sid, overwrite);
}
bool hasElementMap()
bool hasElementMap() const
{
return _elementMap != nullptr;
}

View File

@@ -1302,7 +1302,7 @@ std::string PropertyComplexGeoData::getElementMapVersion(bool) const
}
auto owner = freecad_cast<DocumentObject*>(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 {