From 6e9b2d1bfe9d85af4d7b056e602e959097e00160 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 15 Nov 2018 22:16:29 +0100 Subject: [PATCH] remove superfluous error messages in In/Out list methods --- src/App/DocumentObject.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/App/DocumentObject.cpp b/src/App/DocumentObject.cpp index 58bb1dacc7..d93f3125f4 100644 --- a/src/App/DocumentObject.cpp +++ b/src/App/DocumentObject.cpp @@ -299,10 +299,9 @@ std::vector DocumentObject::getInList(void) const void _getInListRecursive(std::vector& objSet, const DocumentObject* obj, const DocumentObject* checkObj, int depth) { - for (const auto objIt : obj->getInList()){ + for (const auto objIt : obj->getInList()) { // if the check object is in the recursive inList we have a cycle! - if (objIt == checkObj || depth <= 0){ - std::cerr << "DocumentObject::getInListRecursive(): cyclic dependency detected!"< DocumentObject::getInListRecursive(void) const void _getOutListRecursive(std::set& objSet, const DocumentObject* obj, const DocumentObject* checkObj, int depth) { - for (const auto objIt : obj->getOutList()){ + for (const auto objIt : obj->getOutList()) { // if the check object is in the recursive inList we have a cycle! - if (objIt == checkObj || depth <= 0){ - std::cerr << "DocumentObject::getOutListRecursive(): cyclic dependency detected!" << std::endl; + if (objIt == checkObj || depth <= 0) { throw Base::RuntimeError("DocumentObject::getOutListRecursive(): cyclic dependency detected!"); } @@ -412,10 +410,9 @@ bool DocumentObject::_isInInListRecursive(const DocumentObject* /*act*/, if (std::find(_inList.begin(), _inList.end(), test) != _inList.end()) return true; - for (auto obj : _inList){ + for (auto obj : _inList) { // if the check object is in the recursive inList we have a cycle! - if (obj == checkObj || depth <= 0){ - std::cerr << "DocumentObject::isInInListRecursive(): cyclic dependency detected!" << std::endl; + if (obj == checkObj || depth <= 0) { throw Base::RuntimeError("DocumentObject::isInInListRecursive(): cyclic dependency detected!"); } @@ -459,10 +456,9 @@ bool DocumentObject::_isInOutListRecursive(const DocumentObject* act, if (std::find(outList.begin(), outList.end(), test) != outList.end()) return true; - for (auto obj : outList){ + for (auto obj : outList) { // if the check object is in the recursive inList we have a cycle! - if (obj == checkObj || depth <= 0){ - std::cerr << "DocumentObject::isInOutListRecursive(): cyclic dependency detected!" << std::endl; + if (obj == checkObj || depth <= 0) { throw Base::RuntimeError("DocumentObject::isInOutListRecursive(): cyclic dependency detected!"); }