Skip to content

Commit

Permalink
improve whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jan 21, 2017
1 parent 69857f3 commit f3f7b01
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 135 deletions.
21 changes: 12 additions & 9 deletions src/App/Document.cpp
Expand Up @@ -1967,7 +1967,8 @@ int Document::recompute()

std::vector<App::DocumentObject*> Document::topologicalSort() const
{
// topological sort algorithm described here: https://de.wikipedia.org/wiki/Topologische_Sortierung#Algorithmus_f.C3.BCr_das_Topologische_Sortieren
// topological sort algorithm described here:
// https://de.wikipedia.org/wiki/Topologische_Sortierung#Algorithmus_f.C3.BCr_das_Topologische_Sortieren
vector < App::DocumentObject* > ret;
ret.reserve(d->objectArray.size());
map < App::DocumentObject*,int > countMap;
Expand Down Expand Up @@ -2004,7 +2005,7 @@ int Document::recompute()
{
int objectCount = 0;
// delete recompute log
for( auto LogEntry: _RecomputeLog)
for (auto LogEntry: _RecomputeLog)
delete LogEntry;
_RecomputeLog.clear();

Expand Down Expand Up @@ -2035,9 +2036,10 @@ int Document::recompute()
}
#ifdef FC_DEBUG
// check if all objects are recalculated which were thouched
for (auto objectIt : d->objectArray)
for (auto objectIt : d->objectArray) {
if (objectIt->isTouched())
cerr << "Document::recompute(): " << objectIt->getNameInDocument() << " still touched after recompute" << endl;
}
#endif

return objectCount;
Expand Down Expand Up @@ -2692,11 +2694,12 @@ PyObject * Document::getPyObject(void)

std::vector<App::DocumentObject*> Document::getRootObjects() const
{
std::vector < App::DocumentObject* > ret;
std::vector < App::DocumentObject* > ret;

for (auto objectIt : d->objectArray)
if (objectIt->getInList().size() == 0)
ret.push_back(objectIt);
for (auto objectIt : d->objectArray) {
if (objectIt->getInList().empty())
ret.push_back(objectIt);
}

return ret;
}
return ret;
}
4 changes: 3 additions & 1 deletion src/App/DocumentObject.cpp
Expand Up @@ -341,7 +341,9 @@ bool DocumentObject::isInInList(DocumentObject *linkTo) const
#endif
}

bool DocumentObject::_isInOutListRecursive(const DocumentObject *act, const DocumentObject* test, const DocumentObject* checkObj, int depth) const
bool DocumentObject::_isInOutListRecursive(const DocumentObject *act,
const DocumentObject* test,
const DocumentObject* checkObj, int depth) const
{
#ifndef USE_OLD_DAG
std::vector <DocumentObject*> outList = act->getOutList();
Expand Down
7 changes: 3 additions & 4 deletions src/App/DocumentObjectPyImp.cpp
Expand Up @@ -210,14 +210,14 @@ Py::List DocumentObjectPy::getInList(void) const
Py::List DocumentObjectPy::getInListRecursive(void) const
{
Py::List ret;
try{

try {
std::vector<DocumentObject*> list = getDocumentObjectPtr()->getInListRecursive();

for (std::vector<DocumentObject*>::iterator It = list.begin(); It != list.end(); ++It)
ret.append(Py::Object((*It)->getPyObject(), true));

}catch (const Base::Exception& e) {
}
catch (const Base::Exception& e) {
throw Py::IndexError(e.what());
}
return ret;
Expand All @@ -238,7 +238,6 @@ Py::List DocumentObjectPy::getOutListRecursive(void) const
{
Py::List ret;
try {

std::vector<DocumentObject*> list = getDocumentObjectPtr()->getOutListRecursive();

// creat the python list for the output
Expand Down
8 changes: 4 additions & 4 deletions src/App/PropertyLinks.cpp
Expand Up @@ -373,12 +373,12 @@ PropertyLinkSub::~PropertyLinkSub()
// Base class implementer

void PropertyLinkSub::setValue(App::DocumentObject * lValue, const std::vector<std::string> &SubList)
{
{
aboutToSetValue();
#ifndef USE_OLD_DAG
if(_pcLinkSub)
if (_pcLinkSub)
_pcLinkSub->_removeBackLink(static_cast<App::DocumentObject*>(getContainer()));
if(lValue)
if (lValue)
lValue->_addBackLink(static_cast<App::DocumentObject*>(getContainer()));
#endif
_pcLinkSub=lValue;
Expand Down Expand Up @@ -574,7 +574,7 @@ void PropertyLinkSubList::setValue(DocumentObject* lValue,const char* SubName)
//maintain backlinks
for(auto *obj : _lValueList)
obj->_removeBackLink(static_cast<DocumentObject*>(getContainer()));
if(lValue)
if (lValue)
lValue->_addBackLink(static_cast<DocumentObject*>(getContainer()));
#endif

Expand Down

0 comments on commit f3f7b01

Please sign in to comment.