Skip to content

Commit

Permalink
change old DAG implementation to pass unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jan 22, 2017
1 parent 0afb7b6 commit db0fe5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 9 additions & 5 deletions src/App/DocumentObject.cpp
Expand Up @@ -559,17 +559,21 @@ void DocumentObject::unsetupObject()
ext->onExtendedUnsetupObject();
}

void App::DocumentObject::_removeBackLink(DocumentObject* rmfObj)
void App::DocumentObject::_removeBackLink(DocumentObject* rmvObj)
{
#ifndef USE_OLD_DAG
_inList.erase(std::remove(_inList.begin(), _inList.end(), rmfObj), _inList.end());
_inList.erase(std::remove(_inList.begin(), _inList.end(), rmvObj), _inList.end());
#else
(void)rmvObj;
#endif
}

void App::DocumentObject::_addBackLink(DocumentObject* newObje)
void App::DocumentObject::_addBackLink(DocumentObject* newObj)
{
#ifndef USE_OLD_DAG
if ( std::find(_inList.begin(), _inList.end(), newObje) == _inList.end() )
_inList.push_back(newObje);
if ( std::find(_inList.begin(), _inList.end(), newObj) == _inList.end() )
_inList.push_back(newObj);
#else
(void)newObj;
#endif //USE_OLD_DAG
}
4 changes: 0 additions & 4 deletions src/App/DocumentPyImp.cpp
Expand Up @@ -508,7 +508,6 @@ Py::List DocumentPy::getToplogicalSortedObjects(void) const

Py::List DocumentPy::getRootObjects(void) const
{
#ifndef USE_OLD_DAG
std::vector<DocumentObject*> objs = getDocumentPtr()->getRootObjects();
Py::List res;

Expand All @@ -517,9 +516,6 @@ Py::List DocumentPy::getRootObjects(void) const
res.append(Py::Object((*It)->getPyObject(), true));

return res;
#else
return Py::List();
#endif
}

Py::Int DocumentPy::getUndoMode(void) const
Expand Down

0 comments on commit db0fe5b

Please sign in to comment.