App: PR6497 move return statement to new line

This commit is contained in:
Chris Hennes
2022-03-29 12:33:37 -05:00
parent 8c35e7776c
commit f7edc74eee
14 changed files with 76 additions and 38 deletions

View File

@@ -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();