[TD] remove more superfluous nullptr checks
This commit is contained in:
@@ -710,7 +710,7 @@ private:
|
||||
} else if (v->isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId())) {
|
||||
DrawViewDimension* dvd = static_cast<TechDraw::DrawViewDimension*>(v);
|
||||
TechDraw::DrawViewPart* dvp = dvd->getViewPart();
|
||||
if (dvp == nullptr) {
|
||||
if (!dvp) {
|
||||
continue;
|
||||
}
|
||||
double grandParentX = 0.0;
|
||||
@@ -718,7 +718,7 @@ private:
|
||||
if (dvp->isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId())) {
|
||||
TechDraw::DrawProjGroupItem* dpgi = static_cast<TechDraw::DrawProjGroupItem*>(dvp);
|
||||
TechDraw::DrawProjGroup* dpg = dpgi->getPGroup();
|
||||
if (dpg == nullptr) {
|
||||
if (!dpg) {
|
||||
continue;
|
||||
}
|
||||
grandParentX = dpg->X.getValue();
|
||||
|
||||
@@ -1254,7 +1254,7 @@ void CenterLine::Save(Base::Writer &writer) const
|
||||
writer.Stream() << writer.ind() << "<Visible value=\"" << v << "\"/>" << endl;
|
||||
|
||||
//stored geometry
|
||||
if (m_geometry == nullptr) {
|
||||
if (!m_geometry) {
|
||||
return Base::Console().Error("CL::Save - m_geometry is null\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -363,7 +363,7 @@ void CosmeticEdgePy::setCenter(Py::Object arg)
|
||||
pNew = DrawUtil::invertY(pNew);
|
||||
auto oldGeom = getCosmeticEdgePtr()->m_geometry;
|
||||
TechDraw::CirclePtr oldCircle = std::dynamic_pointer_cast<TechDraw::Circle> (oldGeom);
|
||||
if (oldCircle == nullptr) {
|
||||
if (!oldCircle) {
|
||||
throw Py::TypeError("Edge geometry is not a circle");
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
|
||||
}
|
||||
|
||||
App::DocumentObject* base = BaseView.getValue();
|
||||
if (base == nullptr) {
|
||||
if (!base) {
|
||||
return new App::DocumentObjectExecReturn("BaseView object not found");
|
||||
}
|
||||
|
||||
|
||||
@@ -494,7 +494,7 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca
|
||||
}
|
||||
|
||||
base = BaseGeom::baseFactory(edge);
|
||||
if (base == nullptr) {
|
||||
if (!base) {
|
||||
Base::Console().Log("Error - GO::addGeomFromCompound - baseFactory failed for edge: %d\n",i);
|
||||
continue;
|
||||
// throw Base::ValueError("GeometryObject::addGeomFromCompound - baseFactory failed");
|
||||
|
||||
@@ -108,7 +108,7 @@ App::DocumentObjectExecReturn *LandmarkDimension::execute(void)
|
||||
}
|
||||
|
||||
DrawViewPart* dvp = getViewPart();
|
||||
if (dvp == nullptr) {
|
||||
if (!dvp) {
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
References2D.setValue(dvp);
|
||||
|
||||
@@ -161,7 +161,7 @@ std::vector<TopoDS_Shape> ShapeExtractor::getXShapes(const App::Link* xLink)
|
||||
{
|
||||
// Base::Console().Message("SE::getXShapes(%X) - %s\n", xLink, xLink->getNameInDocument());
|
||||
std::vector<TopoDS_Shape> xSourceShapes;
|
||||
if (xLink == nullptr) {
|
||||
if (!xLink) {
|
||||
return xSourceShapes;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user