[TD] Gui: remove some superfluous nullptr checks
This commit is contained in:
@@ -116,7 +116,7 @@ void TaskLineDecor::getDefaults(void)
|
||||
if (!m_edges.empty()) {
|
||||
int num = DrawUtil::getIndexFromName(m_edges.front());
|
||||
BaseGeomPtr bg = m_partFeat->getGeomByIndex(num);
|
||||
if (bg != nullptr) {
|
||||
if (bg) {
|
||||
if (bg->cosmetic) {
|
||||
if (bg->source() == 1) {
|
||||
TechDraw::CosmeticEdge* ce = m_partFeat->getCosmeticEdgeBySelection(m_edges.front());
|
||||
@@ -134,7 +134,7 @@ void TaskLineDecor::getDefaults(void)
|
||||
}
|
||||
} else {
|
||||
TechDraw::GeomFormat* gf = m_partFeat->getGeomFormatBySelection(num);
|
||||
if (gf != nullptr) {
|
||||
if (gf) {
|
||||
m_style = gf->m_format.m_style;
|
||||
m_color = gf->m_format.m_color;
|
||||
m_weight = gf->m_format.m_weight;
|
||||
@@ -142,7 +142,7 @@ void TaskLineDecor::getDefaults(void)
|
||||
} else {
|
||||
Gui::ViewProvider* vp = QGIView::getViewProvider(m_partFeat);
|
||||
auto partVP = dynamic_cast<ViewProviderViewPart*>(vp);
|
||||
if ( partVP != nullptr ) {
|
||||
if (partVP) {
|
||||
m_weight = partVP->LineWidth.getValue();
|
||||
m_style = Qt::SolidLine; // = 1
|
||||
m_color = LineFormat::getDefEdgeColor();
|
||||
@@ -188,7 +188,7 @@ void TaskLineDecor::applyDecorations(void)
|
||||
for (auto& e: m_edges) {
|
||||
int num = DrawUtil::getIndexFromName(e);
|
||||
BaseGeomPtr bg = m_partFeat->getGeomByIndex(num);
|
||||
if (bg != nullptr) {
|
||||
if (bg) {
|
||||
if (bg->cosmetic) {
|
||||
if (bg->source() == 1) {
|
||||
TechDraw::CosmeticEdge* ce = m_partFeat->getCosmeticEdgeBySelection(e);
|
||||
@@ -206,7 +206,7 @@ void TaskLineDecor::applyDecorations(void)
|
||||
}
|
||||
} else {
|
||||
TechDraw::GeomFormat* gf = m_partFeat->getGeomFormatBySelection(num);
|
||||
if (gf != nullptr) {
|
||||
if (gf) {
|
||||
gf->m_format.m_style = m_style;
|
||||
gf->m_format.m_color = m_color;
|
||||
gf->m_format.m_weight = m_weight;
|
||||
@@ -446,7 +446,7 @@ TaskDlgLineDecor::TaskDlgLineDecor(TechDraw::DrawViewPart* partFeat,
|
||||
}
|
||||
|
||||
TaskLineDecor* parent = dynamic_cast<TaskLineDecor*>(widget);
|
||||
if (parent != nullptr) {
|
||||
if (parent) {
|
||||
restore = new TaskRestoreLines(partFeat, parent);
|
||||
restoreBox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/TechDraw_DecorateLine"),
|
||||
tr("Restore Invisible Lines"), true, nullptr);
|
||||
|
||||
Reference in New Issue
Block a user