| 155 | } |
| 156 | |
| 157 | void PropertyGeomFormatList::Restore(Base::XMLReader &reader) |
| 158 | { |
| 159 | // read my element |
| 160 | reader.clearPartialRestoreObject(); |
| 161 | reader.readElement("GeomFormatList"); |
| 162 | // get the value of my attribute |
| 163 | int count = reader.getAttribute<long>("count"); |
| 164 | std::vector<GeomFormat*> values; |
| 165 | values.reserve(count); |
| 166 | for (int i = 0; i < count; i++) { |
| 167 | reader.readElement("GeomFormat"); |
| 168 | const char* TypeName = reader.getAttribute<const char*>("type"); |
| 169 | GeomFormat *newG = static_cast<GeomFormat *>(Base::Type::fromName(TypeName).createInstance()); |
| 170 | newG->Restore(reader); |
| 171 | |
| 172 | if(reader.testStatus(Base::XMLReader::ReaderStatus::PartialRestoreInObject)) { |
| 173 | Base::Console().error("GeomFormat \"%s\" within a PropertyGeomFormatList was subject to a partial restore.\n", reader.localName()); |
| 174 | if(isOrderRelevant()) { |
| 175 | // Pushes the best try by the GeomFormat class |
| 176 | values.push_back(newG); |
| 177 | } |
| 178 | else { |
| 179 | delete newG; |
| 180 | } |
| 181 | reader.clearPartialRestoreObject(); |
| 182 | } |
| 183 | else { |
| 184 | values.push_back(newG); |
| 185 | } |
| 186 | |
| 187 | reader.readEndElement("GeomFormat"); |
| 188 | } |
| 189 | |
| 190 | reader.readEndElement("GeomFormatList"); |
| 191 | |
| 192 | // assignment |
| 193 | setValues(values); |
| 194 | } |
| 195 | |
| 196 | App::Property *PropertyGeomFormatList::Copy() const |
| 197 | { |
nothing calls this directly
no test coverage detected