Merge pull request #19907 from benj5378/getAttribute
Base: make getAttribute template
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user