From db0fe5b2004bb63f7c2f479fd4506b58520c42b5 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 22 Jan 2017 15:32:31 +0100 Subject: [PATCH] change old DAG implementation to pass unit tests --- src/App/DocumentObject.cpp | 14 +++++++++----- src/App/DocumentPyImp.cpp | 4 ---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/App/DocumentObject.cpp b/src/App/DocumentObject.cpp index 8f954fdf4c10..456156ec7f1b 100644 --- a/src/App/DocumentObject.cpp +++ b/src/App/DocumentObject.cpp @@ -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 } diff --git a/src/App/DocumentPyImp.cpp b/src/App/DocumentPyImp.cpp index a73ba2096ad0..79025bca1716 100644 --- a/src/App/DocumentPyImp.cpp +++ b/src/App/DocumentPyImp.cpp @@ -508,7 +508,6 @@ Py::List DocumentPy::getToplogicalSortedObjects(void) const Py::List DocumentPy::getRootObjects(void) const { -#ifndef USE_OLD_DAG std::vector objs = getDocumentPtr()->getRootObjects(); Py::List res; @@ -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