Merge pull request #19907 from benj5378/getAttribute

Base: make getAttribute template
This commit is contained in:
Chris Hennes
2025-05-12 10:39:55 -05:00
committed by GitHub
64 changed files with 834 additions and 677 deletions

View File

@@ -151,12 +151,12 @@ void PropertyCosmeticEdgeList::Restore(Base::XMLReader &reader)
reader.clearPartialRestoreObject();
reader.readElement("CosmeticEdgeList");
// get the value of my attribute
int count = reader.getAttributeAsInteger("count");
int count = reader.getAttribute<long>("count");
std::vector<CosmeticEdge*> values;
values.reserve(count);
for (int i = 0; i < count; i++) {
reader.readElement("CosmeticEdge");
const char* TypeName = reader.getAttribute("type");
const char* TypeName = reader.getAttribute<const char*>("type");
CosmeticEdge *newG = static_cast<CosmeticEdge *>(Base::Type::fromName(TypeName).createInstance());
newG->Restore(reader);