Part: Fix XML output of PropertyGeometryList::Save

Write all XML attributes of the Geometry element into a single line.

Currently the XML output looks:
                        <Geometry type="Part::GeomLineSegment"
 id="-1" migrated="1">

With the fix it will be:
                        <Geometry type="Part::GeomLineSegment" id="-1" migrated="1">
This commit is contained in:
wmayer
2024-10-14 15:11:30 +02:00
committed by Chris Hennes
parent 55b9ed8882
commit 95f0bd0a5c

View File

@@ -229,12 +229,12 @@ void PropertyGeometryList::Save(Writer &writer) const
writer.incInd();
for (int i = 0; i < getSize(); i++) {
writer.Stream() << writer.ind() << "<Geometry type=\""
<< _lValueList[i]->getTypeId().getName() << "\"" << endl;
for( auto &e : _lValueList[i]->getExtensions() ) {
<< _lValueList[i]->getTypeId().getName() << "\"";
for (auto &e : _lValueList[i]->getExtensions() ) {
auto ext = e.lock();
auto gpe = freecad_dynamic_cast<GeometryMigrationPersistenceExtension>(ext.get());
if (gpe)
if (auto gpe = freecad_dynamic_cast<GeometryMigrationPersistenceExtension>(ext.get())) {
gpe->preSave(writer);
}
}
writer.Stream() << " migrated=\"1\">\n";