[TD] last part of removal of superfluous nullptr checks

This commit is contained in:
Uwe
2022-07-20 12:17:16 +02:00
parent b81d7e4864
commit b2bb479788
8 changed files with 75 additions and 121 deletions

View File

@@ -111,17 +111,14 @@ TechDraw::CosmeticVertex* CosmeticExtension::getCosmeticVertexBySelection(std::s
CosmeticVertex* result = nullptr;
App::DocumentObject* extObj = const_cast<App::DocumentObject*> (getExtendedObject());
TechDraw::DrawViewPart* dvp = dynamic_cast<TechDraw::DrawViewPart*>(extObj);
if (dvp == nullptr) {
if (!dvp)
return result;
}
int idx = DrawUtil::getIndexFromName(name);
TechDraw::VertexPtr v = dvp->getProjVertexByIndex(idx);
if (!v) {
if (!v)
return result;
}
if (!v->cosmeticTag.empty()) {
if (!v->cosmeticTag.empty())
result = getCosmeticVertex(v->cosmeticTag);
}
return result;
}
@@ -424,9 +421,8 @@ TechDraw::GeomFormat* CosmeticExtension::getGeomFormatBySelection(std::string na
GeomFormat* result = nullptr;
App::DocumentObject* extObj = const_cast<App::DocumentObject*> (getExtendedObject());
TechDraw::DrawViewPart* dvp = dynamic_cast<TechDraw::DrawViewPart*>(extObj);
if (dvp == nullptr) {
if (!dvp)
return result;
}
int idx = DrawUtil::getIndexFromName(name);
const std::vector<TechDraw::GeomFormat*> formats = GeomFormats.getValues();
for (auto& gf: formats) {