Sketcher: Use isBad() instead of comparing types with ==
This commit is contained in:
@@ -302,7 +302,7 @@ PyObject* ExternalGeometryFacadePy::getExtensionOfType(PyObject* args)
|
||||
|
||||
Base::Type type = Base::Type::fromName(o);
|
||||
|
||||
if (type != Base::Type::badType()) {
|
||||
if (!type.isBad()) {
|
||||
try {
|
||||
std::shared_ptr<const Part::GeometryExtension> ext(
|
||||
this->getExternalGeometryFacadePtr()->getExtension(type));
|
||||
@@ -379,7 +379,7 @@ PyObject* ExternalGeometryFacadePy::hasExtensionOfType(PyObject* args)
|
||||
|
||||
Base::Type type = Base::Type::fromName(o);
|
||||
|
||||
if (type != Base::Type::badType()) {
|
||||
if (!type.isBad()) {
|
||||
try {
|
||||
return Py::new_reference_to(
|
||||
Py::Boolean(this->getExternalGeometryFacadePtr()->hasExtension(type)));
|
||||
@@ -427,7 +427,7 @@ PyObject* ExternalGeometryFacadePy::deleteExtensionOfType(PyObject* args)
|
||||
|
||||
Base::Type type = Base::Type::fromName(o);
|
||||
|
||||
if (type != Base::Type::badType()) {
|
||||
if (!type.isBad()) {
|
||||
try {
|
||||
this->getExternalGeometryFacadePtr()->deleteExtension(type);
|
||||
Py_Return;
|
||||
|
||||
@@ -278,7 +278,7 @@ PyObject* GeometryFacadePy::getExtensionOfType(PyObject* args)
|
||||
|
||||
Base::Type type = Base::Type::fromName(o);
|
||||
|
||||
if (type != Base::Type::badType()) {
|
||||
if (!type.isBad()) {
|
||||
try {
|
||||
std::shared_ptr<const Part::GeometryExtension> ext(
|
||||
this->getGeometryFacadePtr()->getExtension(type));
|
||||
@@ -355,7 +355,7 @@ PyObject* GeometryFacadePy::hasExtensionOfType(PyObject* args)
|
||||
|
||||
Base::Type type = Base::Type::fromName(o);
|
||||
|
||||
if (type != Base::Type::badType()) {
|
||||
if (!type.isBad()) {
|
||||
try {
|
||||
return Py::new_reference_to(
|
||||
Py::Boolean(this->getGeometryFacadePtr()->hasExtension(type)));
|
||||
@@ -403,7 +403,7 @@ PyObject* GeometryFacadePy::deleteExtensionOfType(PyObject* args)
|
||||
|
||||
Base::Type type = Base::Type::fromName(o);
|
||||
|
||||
if (type != Base::Type::badType()) {
|
||||
if (!type.isBad()) {
|
||||
try {
|
||||
this->getGeometryFacadePtr()->deleteExtension(type);
|
||||
Py_Return;
|
||||
|
||||
Reference in New Issue
Block a user