summaryrefslogtreecommitdiffstats
path: root/Project/ElementDataObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project/ElementDataObject.cpp')
-rw-r--r--Project/ElementDataObject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Project/ElementDataObject.cpp b/Project/ElementDataObject.cpp
index a5ac165..0ea01cb 100644
--- a/Project/ElementDataObject.cpp
+++ b/Project/ElementDataObject.cpp
@@ -15,8 +15,8 @@ ElementDataObject::ElementDataObject(std::vector<Element*> elementList)
for(auto it = elementList.begin(), itEnd = elementList.end(); it != itEnd; ++it) {
Element* copy = (*it)->GetCopy();
if(copy) {
- if(typeid(*copy) == typeid(Bus))
- m_elementsLists->parentList.push_back((Bus*)copy);
+ if(Bus* bus = dynamic_cast<Bus*>(copy))
+ m_elementsLists->parentList.push_back(bus);
else
m_elementsLists->elementList.push_back(copy);
}