TopoNaming: Enable migration code for 1.0.X -> 1.1 (#26538)

This commit is contained in:
drwho495
2025-12-30 06:24:09 -06:00
committed by GitHub
parent 0ced25c6dc
commit e9ea3d0d25
2 changed files with 7 additions and 3 deletions

View File

@@ -200,12 +200,12 @@ const std::string& ComplexGeoData::elementMapPrefix()
std::string ComplexGeoData::getElementMapVersion() const
{
return "4";
return "5";
}
bool ComplexGeoData::checkElementMapVersion(const char* ver) const
{
return !boost::equals(ver, "3") && !boost::equals(ver, "4") && !boost::starts_with(ver, "3.");
return !boost::ends_with(ver, "5");
}
size_t ComplexGeoData::getElementMapSize(bool flush) const

View File

@@ -492,7 +492,7 @@ void PropertyPartShape::Restore(Base::XMLReader& reader)
if (owner ? owner->checkElementMapVersion(this, _Ver.c_str())
: _Shape.checkElementMapVersion(_Ver.c_str())) {
auto ver = owner ? owner->getElementMapVersion(this) : _Shape.getElementMapVersion();
if (!owner || !owner->getNameInDocument() || !_Shape.getElementMapSize()) {
if (!owner || !owner->getNameInDocument()) {
_Ver = ver;
}
else {
@@ -507,6 +507,10 @@ void PropertyPartShape::Restore(Base::XMLReader& reader)
);
}
owner->getDocument()->addRecomputeObject(owner);
// sometimes objects will not update _Ver properly,
// so lets do it here to avoid unnecessary remigration
_Ver = ver;
}
}
}