From 4aa91f0f2641cb2202babd388d6f3eeeb470c48e Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 5 Dec 2020 08:08:04 +0100 Subject: [PATCH] Sketcher: SketchGeometryExtension - Do not store ID =================================================== Currently the ID is a unique number without an specific use and it is conceived to be taken over by future RT's Sketcher PRs. Because of this, and not to interfere with RT's implementation, it is not stored, but will be restored if attribute available. Unrelated: Similarly, ExternalGeometryExtension is also there conceived for RT's future sketcher PRs, but it is not used. --- src/Mod/Sketcher/App/SketchGeometryExtension.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchGeometryExtension.cpp b/src/Mod/Sketcher/App/SketchGeometryExtension.cpp index 0f42c13c00..3599ba2489 100644 --- a/src/Mod/Sketcher/App/SketchGeometryExtension.cpp +++ b/src/Mod/Sketcher/App/SketchGeometryExtension.cpp @@ -61,7 +61,7 @@ void SketchGeometryExtension::Save(Base::Writer &writer) const if(name.size() > 0) writer.Stream() << "\" name=\"" << name; - writer.Stream() << "\" id=\"" << Id + writer.Stream() // << "\" id=\"" << Id // This is removed as the stored Id is not used and it may interfere with RT's future implementation << "\" internalGeometryType=\"" << (int) InternalGeometryType << "\" geometryModeFlags=\"" << GeometryModeFlags.to_string() << "\"/>" << std::endl; @@ -71,7 +71,9 @@ void SketchGeometryExtension::Restore(Base::XMLReader &reader) { restoreNameAttribute(reader); - Id = reader.getAttributeAsInteger("id"); + if(reader.hasAttribute("id")) + Id = reader.getAttributeAsInteger("id"); + InternalGeometryType = (InternalType::InternalType) reader.getAttributeAsInteger("internalGeometryType"); GeometryModeFlags = GeometryModeFlagType(reader.getAttribute("geometryModeFlags"));