Trivial code formatting for some {.cpp,.h} files

This commit is contained in:
luz.paz
2020-04-03 12:30:58 -04:00
committed by Yorik van Havre
parent a45738c629
commit d36c3ebe57
14 changed files with 95 additions and 94 deletions

View File

@@ -78,7 +78,7 @@ public:
DocumentObjectExecReturn(const char* sWhy, DocumentObject* WhichObject=0)
: Which(WhichObject)
{
if(sWhy)
if (sWhy)
Why = sWhy;
}

View File

@@ -74,13 +74,13 @@ Extension::~Extension()
void Extension::initExtensionType(Base::Type type) {
m_extensionType = type;
if(m_extensionType.isBad())
if (m_extensionType.isBad())
throw Base::RuntimeError("Extension: Extension type not set");
}
void Extension::initExtension(ExtensionContainer* obj) {
if(m_extensionType.isBad())
if (m_extensionType.isBad())
throw Base::RuntimeError("Extension: Extension type not set");
//all properties are initialised without PropertyContainer father. Now that we know it we can
@@ -107,13 +107,13 @@ PyObject* Extension::getExtensionPyObject(void) {
std::string Extension::name() const {
if(m_extensionType.isBad())
if (m_extensionType.isBad())
throw Base::RuntimeError("Extension::name: Extension type not set");
std::string temp(m_extensionType.getName());
std::string::size_type pos = temp.find_last_of(':');
if(pos != std::string::npos)
if (pos != std::string::npos)
return temp.substr(pos+1);
else
return std::string();

View File

@@ -329,7 +329,7 @@ public:
* before, and only then will it call the property's aboutToSetValue().
*/
void aboutToChange() {
if(!mProp.hasChanged) {
if (!mProp.hasChanged) {
mProp.hasChanged = true;
mProp.aboutToSetValue();
}
@@ -350,12 +350,12 @@ public:
// Must make sure to not throw in a destructor
try {
mProp.hasSetValue();
}catch(Base::Exception &e) {
} catch(Base::Exception &e) {
e.ReportException();
}catch(...) {}
} catch(...) {}
mProp.hasChanged = false;
}
if(mProp.signalCounter>0)
if (mProp.signalCounter>0)
mProp.signalCounter--;
}
@@ -367,9 +367,9 @@ public:
// Destructor cannot throw. So we provide this function to allow error
// propagation.
void tryInvoke() {
if(mProp.signalCounter==1 && mProp.hasChanged) {
if (mProp.signalCounter==1 && mProp.hasChanged) {
mProp.hasSetValue();
if(mProp.signalCounter>0)
if (mProp.signalCounter>0)
--mProp.signalCounter;
mProp.hasChanged = false;
}
@@ -500,14 +500,14 @@ public:
virtual void set1Value(int index, const_reference value) {
int size = getSize();
if(index<-1 || index>size)
if (index<-1 || index>size)
throw Base::RuntimeError("index out of bound");
atomic_change guard(*this);
if(index==-1 || index == size) {
if (index==-1 || index == size) {
index = size;
setSize(index+1,value);
}else
} else
_lValueList[index] = value;
this->_touchList.insert(index);
guard.tryInvoke();
@@ -517,17 +517,17 @@ protected:
void setPyValues(const std::vector<PyObject*> &vals, const std::vector<int> &indices) override
{
if(indices.empty()) {
if (indices.empty()) {
ListT values;
values.resize(vals.size());
for(std::size_t i=0,count=vals.size();i<count;++i)
for (std::size_t i=0,count=vals.size();i<count;++i)
values[i] = getPyValue(vals[i]);
setValues(std::move(values));
return;
}
assert(vals.size()==indices.size());
atomic_change guard(*this);
for(int i=0,count=indices.size();i<count;++i)
for (int i=0,count=indices.size();i<count;++i)
set1Value(indices[i],getPyValue(vals[i]));
guard.tryInvoke();
}