From 84d850afc944d65b6b4e0891c26452decd57a54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Althaus?= Date: Tue, 14 Jan 2025 22:53:27 +0100 Subject: [PATCH] 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. --- src/Mod/Part/App/PropertyTopoShape.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Mod/Part/App/PropertyTopoShape.cpp b/src/Mod/Part/App/PropertyTopoShape.cpp index 1a71419533..dba06ef6d5 100644 --- a/src/Mod/Part/App/PropertyTopoShape.cpp +++ b/src/Mod/Part/App/PropertyTopoShape.cpp @@ -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");