From 3750a0691f4975045647f3f70d8215fb1884e6fb Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 29 Dec 2016 14:07:52 -0200 Subject: Text element paste bug corrected --- Project/ElementDataObject.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'Project/ElementDataObject.cpp') diff --git a/Project/ElementDataObject.cpp b/Project/ElementDataObject.cpp index ff2feed..a5ac165 100644 --- a/Project/ElementDataObject.cpp +++ b/Project/ElementDataObject.cpp @@ -1,25 +1,27 @@ #include "ElementDataObject.h" -ElementDataObject::ElementDataObject() : wxDataObjectSimple(wxDataFormat("PSPCopy")) +ElementDataObject::ElementDataObject() + : wxDataObjectSimple(wxDataFormat("PSPCopy")) { m_elementsLists = new ElementsLists(); } -ElementDataObject::ElementDataObject(std::vector elementList) : wxDataObjectSimple(wxDataFormat("PSPCopy")) +ElementDataObject::ElementDataObject(std::vector elementList) + : wxDataObjectSimple(wxDataFormat("PSPCopy")) { m_elementsLists = new ElementsLists(); if(elementList.size() > 0) { - // Separate buses (parents) from the rest of the elements (childs). - 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); - else - m_elementsLists->elementList.push_back(copy); - } - } - } + // Separate buses (parents) from the rest of the elements (childs). + 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); + else + m_elementsLists->elementList.push_back(copy); + } + } + } } ElementDataObject::~ElementDataObject() {} -- cgit