diff --git a/src/App/AutoTransaction.cpp b/src/App/AutoTransaction.cpp index 5803ebcb87..6597f7109c 100644 --- a/src/App/AutoTransaction.cpp +++ b/src/App/AutoTransaction.cpp @@ -160,7 +160,8 @@ const char *Application::getActiveTransaction(int *id) const { void Application::closeActiveTransaction(bool abort, int id) { if(!id) id = _activeTransactionID; - if(!id) return; + if(!id) + return; if(_activeTransactionGuard>0 && !abort) { FC_LOG("ignore close transaction"); diff --git a/src/App/ComplexGeoData.cpp b/src/App/ComplexGeoData.cpp index adab0b8a0a..c3a88688cd 100644 --- a/src/App/ComplexGeoData.cpp +++ b/src/App/ComplexGeoData.cpp @@ -172,9 +172,11 @@ const char *ComplexGeoData::isMappedElement(const char *name) { } std::string ComplexGeoData::newElementName(const char *name) { - if(!name) return std::string(); + if(!name) + return std::string(); const char *dot = strrchr(name,'.'); - if(!dot || dot==name) return name; + if(!dot || dot==name) + return name; const char *c = dot-1; for(;c!=name;--c) { if(*c == '.') { @@ -188,9 +190,11 @@ std::string ComplexGeoData::newElementName(const char *name) { } std::string ComplexGeoData::oldElementName(const char *name) { - if(!name) return std::string(); + if(!name) + return std::string(); const char *dot = strrchr(name,'.'); - if(!dot || dot==name) return name; + if(!dot || dot==name) + return name; const char *c = dot-1; for(;c!=name;--c) { if(*c == '.') { @@ -204,7 +208,8 @@ std::string ComplexGeoData::oldElementName(const char *name) { } std::string ComplexGeoData::noElementName(const char *name) { - if(!name) return std::string(); + if(!name) + return std::string(); auto element = findElementName(name); if(element) return std::string(name,element-name); diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 991a6fe34b..3fa9a00395 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -1170,7 +1170,8 @@ void Document::_checkTransaction(DocumentObject* pcDelObj, const Property *What, return; } } - if(!pcDelObj) return; + if(!pcDelObj) + return; // When the object is going to be deleted we have to check if it has already been added to // the undo transactions std::list::iterator it; diff --git a/src/App/DocumentObject.cpp b/src/App/DocumentObject.cpp index 5beefe7c3f..fa0c215981 100644 --- a/src/App/DocumentObject.cpp +++ b/src/App/DocumentObject.cpp @@ -275,7 +275,8 @@ const char *DocumentObject::getNameInDocument() const // to an object that has been removed from the document. In this case we should rather // return 0. //assert(pcNameInDocument); - if (!pcNameInDocument) return nullptr; + if (!pcNameInDocument) + return nullptr; return pcNameInDocument->c_str(); } @@ -1055,7 +1056,8 @@ void App::DocumentObject::_addBackLink(DocumentObject* newObj) int DocumentObject::setElementVisible(const char *element, bool visible) { for(auto ext : getExtensionsDerivedFromType()) { int ret = ext->extensionSetElementVisible(element,visible); - if(ret>=0) return ret; + if(ret>=0) + return ret; } return -1; @@ -1064,7 +1066,8 @@ int DocumentObject::setElementVisible(const char *element, bool visible) { int DocumentObject::isElementVisible(const char *element) const { for(auto ext : getExtensionsDerivedFromType()) { int ret = ext->extensionIsElementVisible(element); - if(ret>=0) return ret; + if(ret>=0) + return ret; } return -1; @@ -1256,7 +1259,8 @@ const std::string &DocumentObject::hiddenMarker() { } const char *DocumentObject::hasHiddenMarker(const char *subname) { - if(!subname) return nullptr; + if(!subname) + return nullptr; const char *marker = strrchr(subname,'.'); if(!marker) marker = subname; diff --git a/src/App/DocumentPyImp.cpp b/src/App/DocumentPyImp.cpp index ec02a6b4b6..236bdaeb7f 100644 --- a/src/App/DocumentPyImp.cpp +++ b/src/App/DocumentPyImp.cpp @@ -835,7 +835,8 @@ int DocumentPy::setCustomAttributes(const char* attr, PyObject *) return 0; } PyObject* item = PyDict_GetItemString(this->ob_type->tp_dict, attr); - if (item) return 0; + if (item) + return 0; DocumentObject* obj = getDocumentPtr()->getObject(attr); if (obj) { diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index 54836181e1..ec918dcd58 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -3158,7 +3158,8 @@ double num_change(char* yytext,char dez_delim,char grp_delim) else temp[i++] = *c; // check buffer overflow - if (i>39) return 0.0; + if (i>39) + return 0.0; } temp[i] = '\0'; diff --git a/src/App/ExtensionContainer.cpp b/src/App/ExtensionContainer.cpp index db26f4b359..0c3d9022a9 100644 --- a/src/App/ExtensionContainer.cpp +++ b/src/App/ExtensionContainer.cpp @@ -102,7 +102,8 @@ Extension* ExtensionContainer::getExtension(Base::Type t, bool derived, bool no_ if(entry.first.isDerivedFrom(t)) return entry.second; } - if(no_except) return nullptr; + if(no_except) + return nullptr; //if we arrive here we don't have anything matching throw Base::TypeError("ExtensionContainer::getExtension: No extension of given type available"); } @@ -110,7 +111,8 @@ Extension* ExtensionContainer::getExtension(Base::Type t, bool derived, bool no_ return result->second; } else { - if(no_except) return nullptr; + if(no_except) + return nullptr; //if we arrive here we don't have anything matching throw Base::TypeError("ExtensionContainer::getExtension: No extension of given type available"); } diff --git a/src/App/GeoFeature.cpp b/src/App/GeoFeature.cpp index 51a46511ab..0015d545d0 100644 --- a/src/App/GeoFeature.cpp +++ b/src/App/GeoFeature.cpp @@ -87,7 +87,8 @@ std::pair GeoFeature::getElementName( (void)type; std::pair ret; - if(!name) return ret; + if(!name) + return ret; ret.second = name; return ret; diff --git a/src/App/Link.cpp b/src/App/Link.cpp index c1cdf5e97c..1532a49014 100644 --- a/src/App/Link.cpp +++ b/src/App/Link.cpp @@ -399,7 +399,8 @@ App::DocumentObjectExecReturn *LinkBaseExtension::extensionExecute(void) { short LinkBaseExtension::extensionMustExecute(void) { auto link = getLink(); - if(!link) return 0; + if(!link) + return 0; return link->mustExecute(); } @@ -982,7 +983,8 @@ int LinkBaseExtension::extensionSetElementVisible(const char *element, bool visi if(!propElementVis || !element || !element[0]) return -1; if(propElementVis->getSize()<=index) { - if(visible) return 1; + if(visible) + return 1; propElementVis->setSize(index+1, true); } propElementVis->setStatus(Property::User3,true); @@ -1047,10 +1049,12 @@ int LinkBaseExtension::getArrayIndex(const char *subname, const char **psubname) return -1; const char *dot = strchr(subname,'.'); if(!dot) dot= subname+strlen(subname); - if(dot == subname) return -1; + if(dot == subname) + return -1; int idx = 0; for(const char *c=subname;c!=dot;++c) { - if(!isdigit(*c)) return -1; + if(!isdigit(*c)) + return -1; idx = idx*10 + *c -'0'; } if(psubname) { @@ -1072,7 +1076,8 @@ int LinkBaseExtension::getElementIndex(const char *subname, const char **psubnam if(isdigit(subname[0])) { // If the name start with digits, treat as index reference idx = getArrayIndex(subname,nullptr); - if(idx<0) return -1; + if(idx<0) + return -1; if(_getElementCountProperty()) { if(idx>=_getElementCountValue()) return -1; @@ -1103,7 +1108,8 @@ int LinkBaseExtension::getElementIndex(const char *subname, const char **psubnam // Then check for the actual linked object's name or label, and // redirect that reference to the first array element auto linked = getTrueLinkedObject(false); - if(!linked || !linked->getNameInDocument()) return -1; + if(!linked || !linked->getNameInDocument()) + return -1; if(subname[0]=='$') { CharRange sub(subname+1, dot); if (boost::equals(sub, linked->Label.getValue())) @@ -1424,7 +1430,8 @@ DocumentObject *LinkBaseExtension::getTrueLinkedObject( } auto ret = getLink(depth); - if(!ret) return nullptr; + if(!ret) + return nullptr; bool transform = linkTransform(); const char *subname = getSubName(); if(subname || (mat && transform)) { @@ -1557,7 +1564,8 @@ void LinkBaseExtension::updateGroup() { } void LinkBaseExtension::update(App::DocumentObject *parent, const Property *prop) { - if(!prop) return; + if(!prop) + return; if(prop == getLinkPlacementProperty() || prop == getPlacementProperty()) { auto src = getLinkPlacementProperty(); diff --git a/src/App/ObjectIdentifier.cpp b/src/App/ObjectIdentifier.cpp index ac3ac9a5b4..3d1c2589a9 100644 --- a/src/App/ObjectIdentifier.cpp +++ b/src/App/ObjectIdentifier.cpp @@ -297,11 +297,13 @@ int ObjectIdentifier::numSubComponents() const bool ObjectIdentifier::verify(const App::Property &prop, bool silent) const { ResolveResults result(*this); if(components.size() - result.propertyIndex != 1) { - if(silent) return false; + if(silent) + return false; FC_THROWM(Base::ValueError,"Invalid property path: single component expected"); } if(!components[result.propertyIndex].isSimple()) { - if(silent) return false; + if(silent) + return false; FC_THROWM(Base::ValueError,"Invalid property path: simple component expected"); } const std::string &name = components[result.propertyIndex].getName(); @@ -310,7 +312,8 @@ bool ObjectIdentifier::verify(const App::Property &prop, bool silent) const { if((isAddress && addr.toString(CellAddress::Cell::ShowRowColumn) != prop.getName()) || (!isAddress && name!=prop.getName())) { - if(silent) return false; + if(silent) + return false; FC_THROWM(Base::ValueError,"Invalid property path: name mismatch"); } return true; diff --git a/src/App/PropertyContainer.cpp b/src/App/PropertyContainer.cpp index 8faea17b58..e66628eae9 100644 --- a/src/App/PropertyContainer.cpp +++ b/src/App/PropertyContainer.cpp @@ -77,7 +77,8 @@ App::Property* PropertyContainer::addDynamicProperty( Property *PropertyContainer::getPropertyByName(const char* name) const { auto prop = dynamicProps.getDynamicPropertyByName(name); - if(prop) return prop; + if(prop) + return prop; return getPropertyData().getPropertyByName(this,name); } @@ -120,28 +121,32 @@ short PropertyContainer::getPropertyType(const char *name) const const char* PropertyContainer::getPropertyGroup(const Property* prop) const { auto group = dynamicProps.getPropertyGroup(prop); - if(group) return group; + if(group) + return group; return getPropertyData().getGroup(this,prop); } const char* PropertyContainer::getPropertyGroup(const char *name) const { auto group = dynamicProps.getPropertyGroup(name); - if(group) return group; + if(group) + return group; return getPropertyData().getGroup(this,name); } const char* PropertyContainer::getPropertyDocumentation(const Property* prop) const { auto doc = dynamicProps.getPropertyDocumentation(prop); - if(doc) return doc; + if(doc) + return doc; return getPropertyData().getDocumentation(this,prop); } const char* PropertyContainer::getPropertyDocumentation(const char *name) const { auto doc = dynamicProps.getPropertyDocumentation(name); - if(doc) return doc; + if(doc) + return doc; return getPropertyData().getDocumentation(this,name); } diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index b42f5b416a..7e899b9a2b 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -649,7 +649,8 @@ void PropertyLinkList::set1Value(int idx, DocumentObject* const &value) { DocumentObject *obj = nullptr; if(idx>=0 && idx<(int)_lValueList.size()) { obj = _lValueList[idx]; - if(obj == value) return; + if(obj == value) + return; } if(!value || !value->getNameInDocument()) @@ -2806,7 +2807,8 @@ public: } void slotFinishRestoreDocument(const App::Document &doc) { - if(pcDoc) return; + if(pcDoc) + return; QString fullpath(getFullPath()); if(!fullpath.isEmpty() && getFullPath(doc.getFileName())==fullpath) attach(const_cast(&doc)); @@ -2817,7 +2819,8 @@ public: slotFinishRestoreDocument(doc); return; } - if(&doc!=pcDoc) return; + if(&doc!=pcDoc) + return; QFileInfo info(myPos->first); // QString path(info.canonicalFilePath()); @@ -2879,7 +2882,8 @@ public: deinit(); return; } - if(pcDoc!=&doc) return; + if(pcDoc!=&doc) + return; std::map > parentLinks; for(auto link : links) { link->setFlag(PropertyLinkBase::LinkDetached); diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index 0fc1cf9821..abfc5d443c 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -1374,7 +1374,8 @@ PropertyString::~PropertyString() void PropertyString::setValue(const char* newLabel) { - if(!newLabel) return; + if(!newLabel) + return; if(_cValue == newLabel) return; diff --git a/src/App/Transactions.cpp b/src/App/Transactions.cpp index 297942a79a..a345e375d2 100644 --- a/src/App/Transactions.cpp +++ b/src/App/Transactions.cpp @@ -99,7 +99,8 @@ static std::atomic _TransactionID; int Transaction::getNewID() { int id = ++_TransactionID; - if(id) return id; + if(id) + return id; // wrap around? really? return ++_TransactionID; }