Always update the element map version if it's not valid or unknown

_Ver can contain "?" after loading and in some circumstances this is not
cleared (often by setValue()) before saving (MultiPattern children or empty Part::Feature).
When saved the same "?" is then written again to the file causing the
recomputing dialog to pop up again and again.

This not only checks for an empty _Ver but also explicitly for "?" and
then regenerating the version if necessary.
This commit is contained in:
André Althaus
2025-01-14 22:53:27 +01:00
committed by Chris Hennes
parent a6c92e19f6
commit 84d850afc9

View File

@@ -271,11 +271,14 @@ void PropertyPartShape::Save (Base::Writer &writer) const
}
std::string version;
// If exporting, do not export mapped element name, but still make a mark
if(owner) {
if(!owner->isExporting())
version = _Ver.size()?_Ver:owner->getElementMapVersion(this);
}else
version = _Ver.size()?_Ver:_Shape.getElementMapVersion();
auto const version_valid = _Ver.size() && (_Ver != "?");
if (owner) {
if (!owner->isExporting()) {
version = version_valid ? _Ver : owner->getElementMapVersion(this);
}
} else {
version = version_valid ? _Ver : _Shape.getElementMapVersion();
}
writer.Stream() << " ElementMap=\"" << version << '"';
bool binary = writer.getMode("BinaryBrep");