CAM: apply precommit

This commit is contained in:
Adrian Insaurralde Avalos
2024-09-03 14:54:36 -04:00
parent 261ef09348
commit a17a3cf6d7
337 changed files with 26842 additions and 25585 deletions

View File

@@ -36,19 +36,23 @@ std::string FeaturePathCompoundPy::representation() const
}
PyObject* FeaturePathCompoundPy::addObject(PyObject *args)
PyObject* FeaturePathCompoundPy::addObject(PyObject* args)
{
PyObject *object;
if (!PyArg_ParseTuple(args, "O!", &(DocumentObjectPy::Type), &object))
PyObject* object;
if (!PyArg_ParseTuple(args, "O!", &(DocumentObjectPy::Type), &object)) {
return nullptr;
}
DocumentObjectPy* docObj = static_cast<DocumentObjectPy*>(object);
if (!docObj->getDocumentObjectPtr() || !docObj->getDocumentObjectPtr()->isAttachedToDocument()) {
if (!docObj->getDocumentObjectPtr()
|| !docObj->getDocumentObjectPtr()->isAttachedToDocument()) {
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot add an invalid object");
return nullptr;
}
if (docObj->getDocumentObjectPtr()->getDocument() != getFeaturePathCompoundPtr()->getDocument()) {
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot add an object from another document to this group");
if (docObj->getDocumentObjectPtr()->getDocument()
!= getFeaturePathCompoundPtr()->getDocument()) {
PyErr_SetString(Base::PyExc_FC_GeneralError,
"Cannot add an object from another document to this group");
return nullptr;
}
if (docObj->getDocumentObjectPtr() == this->getFeaturePathCompoundPtr()) {
@@ -81,19 +85,23 @@ PyObject* FeaturePathCompoundPy::addObject(PyObject *args)
}
PyObject* FeaturePathCompoundPy::removeObject(PyObject *args)
PyObject* FeaturePathCompoundPy::removeObject(PyObject* args)
{
PyObject *object;
if (!PyArg_ParseTuple(args, "O!", &(DocumentObjectPy::Type), &object))
PyObject* object;
if (!PyArg_ParseTuple(args, "O!", &(DocumentObjectPy::Type), &object)) {
return nullptr;
}
DocumentObjectPy* docObj = static_cast<DocumentObjectPy*>(object);
if (!docObj->getDocumentObjectPtr() || !docObj->getDocumentObjectPtr()->isAttachedToDocument()) {
if (!docObj->getDocumentObjectPtr()
|| !docObj->getDocumentObjectPtr()->isAttachedToDocument()) {
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot remove an invalid object");
return nullptr;
}
if (docObj->getDocumentObjectPtr()->getDocument() != getFeaturePathCompoundPtr()->getDocument()) {
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot remove an object from another document from this group");
if (docObj->getDocumentObjectPtr()->getDocument()
!= getFeaturePathCompoundPtr()->getDocument()) {
PyErr_SetString(Base::PyExc_FC_GeneralError,
"Cannot remove an object from another document from this group");
return nullptr;
}
@@ -122,8 +130,7 @@ PyObject* FeaturePathCompoundPy::removeObject(PyObject *args)
}
PyObject *FeaturePathCompoundPy::getCustomAttributes(const char* /*attr*/) const
PyObject* FeaturePathCompoundPy::getCustomAttributes(const char* /*attr*/) const
{
return nullptr;
}