diff --git a/src/Gui/DAGView/DAGFilter.cpp b/src/Gui/DAGView/DAGFilter.cpp index e331d52d2e..1545143a27 100644 --- a/src/Gui/DAGView/DAGFilter.cpp +++ b/src/Gui/DAGView/DAGFilter.cpp @@ -44,7 +44,7 @@ FilterOrigin::FilterOrigin() : FilterBase() bool FilterOrigin::goFilter(const Vertex &vertexIn, const Graph &graphIn, const GraphLinkContainer &linkIn) const { Base::Type originType = Base::Type::fromName("App::Origin"); - assert (originType != Base::Type::badType()); + assert (!originType.isBad()); //if child of origin hide. InEdgeIterator it, itEnd; for (boost::tie(it, itEnd) = boost::in_edges(vertexIn, graphIn); it != itEnd; ++it) @@ -72,7 +72,7 @@ bool FilterTyped::goFilter(const Gui::DAG::Vertex& vertexIn, const Graph& graphI if (type.empty()) return false; Base::Type theType = Base::Type::fromName(type.c_str()); - if (theType == Base::Type::badType()) + if (theType.isBad()) return false; const GraphLinkRecord &sourceRecord = findRecord(vertexIn, linkIn); diff --git a/src/Gui/DAGView/DAGModel.cpp b/src/Gui/DAGView/DAGModel.cpp index 9dc8a902a9..a699d94470 100644 --- a/src/Gui/DAGView/DAGModel.cpp +++ b/src/Gui/DAGView/DAGModel.cpp @@ -1186,11 +1186,11 @@ void Model::visiblyIsolate(Gui::DAG::Vertex sourceIn) std::vector out; Base::Type type; type = Base::Type::fromName("App::DocumentObjectGroup"); - if (type != Base::Type::badType()) out.push_back(type); + if (!type.isBad()) out.push_back(type); type = Base::Type::fromName("App::Part"); - if (type != Base::Type::badType()) out.push_back(type); + if (!type.isBad()) out.push_back(type); type = Base::Type::fromName("PartDesign::Body"); - if (type != Base::Type::badType()) out.push_back(type); + if (!type.isBad()) out.push_back(type); return out; }; diff --git a/src/Gui/Dialogs/DlgAddPropertyVarSet.cpp b/src/Gui/Dialogs/DlgAddPropertyVarSet.cpp index 312666ded2..1b505e7365 100644 --- a/src/Gui/Dialogs/DlgAddPropertyVarSet.cpp +++ b/src/Gui/Dialogs/DlgAddPropertyVarSet.cpp @@ -441,7 +441,7 @@ void DlgAddPropertyVarSet::checkGroup() { void DlgAddPropertyVarSet::checkType() { std::string type = ui->comboBoxType->currentText().toStdString(); - if (Base::Type::fromName(type.c_str()) == Base::Type::badType()) { + if (Base::Type::fromName(type.c_str()).isBad()) { throw CreatePropertyException("Invalid name"); } } diff --git a/src/Gui/Dialogs/DlgExpressionInput.cpp b/src/Gui/Dialogs/DlgExpressionInput.cpp index 98e279af6a..708bf25c2e 100644 --- a/src/Gui/Dialogs/DlgExpressionInput.cpp +++ b/src/Gui/Dialogs/DlgExpressionInput.cpp @@ -190,7 +190,7 @@ Base::Type DlgExpressionInput::determineTypeVarSet() bool DlgExpressionInput::typeOkForVarSet() { std::string unitType = impliedUnit.getTypeString(); - return determineTypeVarSet() != Base::Type::badType(); + return !determineTypeVarSet().isBad(); } void DlgExpressionInput::initializeVarSets() diff --git a/src/Gui/Selection/Selection.cpp b/src/Gui/Selection/Selection.cpp index 0c9b8c65a8..9a9a2ea94b 100644 --- a/src/Gui/Selection/Selection.cpp +++ b/src/Gui/Selection/Selection.cpp @@ -330,7 +330,7 @@ std::vector SelectionSingleton::getObjectList(const char* pDocN std::map SortMap; // check the type - if (typeId == Base::Type::badType()) + if (typeId.isBad()) return temp; App::Document *pcDoc = nullptr; @@ -519,7 +519,7 @@ vector SelectionSingleton::getObjectsOfType(const Base::Ty std::vector SelectionSingleton::getObjectsOfType(const char* typeName, const char* pDocName, ResolveMode resolve) const { Base::Type typeId = Base::Type::fromName(typeName); - if (typeId == Base::Type::badType()) + if (typeId.isBad()) return {}; return getObjectsOfType(typeId, pDocName, resolve); } @@ -541,7 +541,7 @@ unsigned int SelectionSingleton::countObjectsOfType(const Base::Type& typeId, co unsigned int SelectionSingleton::countObjectsOfType(const char* typeName, const char* pDocName, ResolveMode resolve) const { Base::Type typeId = Base::Type::fromName(typeName); - if (typeId == Base::Type::badType()) + if (typeId.isBad()) return 0; return countObjectsOfType(typeId, pDocName, resolve); }