| 2276 | //----------------------------------------------------------------------------- |
| 2277 | |
| 2278 | bool SimObject::setInheritFrom(void* obj, const char* index, const char* data) |
| 2279 | { |
| 2280 | SimObject* object = static_cast<SimObject*>(obj); |
| 2281 | |
| 2282 | SimObject* parent; |
| 2283 | if (Sim::findObject(data, parent)) |
| 2284 | { |
| 2285 | object->setCopySource(parent); |
| 2286 | object->assignFieldsFrom(parent); |
| 2287 | |
| 2288 | // copy any substitution statements |
| 2289 | SimDataBlock* parent_db = dynamic_cast<SimDataBlock*>(parent); |
| 2290 | if (parent_db) |
| 2291 | { |
| 2292 | SimDataBlock* currentNewObject_db = dynamic_cast<SimDataBlock*>(object); |
| 2293 | if (currentNewObject_db) |
| 2294 | currentNewObject_db->copySubstitutionsFrom(parent_db); |
| 2295 | } |
| 2296 | } |
| 2297 | |
| 2298 | return true; |
| 2299 | } |
| 2300 | |
| 2301 | //----------------------------------------------------------------------------- |
| 2302 |
nothing calls this directly
no test coverage detected