From 1ae137aebaaec2d5e9fd4af7295c6a5b2c394fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Br=C3=A6strup=20Sayoc?= Date: Tue, 12 Jul 2022 17:08:38 +0200 Subject: [PATCH] [TechDraw] Improve readability of TaskCenterLine.cpp --- src/Mod/TechDraw/Gui/TaskCenterLine.cpp | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Mod/TechDraw/Gui/TaskCenterLine.cpp b/src/Mod/TechDraw/Gui/TaskCenterLine.cpp index 03b29a6466..309a067641 100644 --- a/src/Mod/TechDraw/Gui/TaskCenterLine.cpp +++ b/src/Mod/TechDraw/Gui/TaskCenterLine.cpp @@ -330,28 +330,28 @@ void TaskCenterLine::createCenterLine(void) } } - if (cl != nullptr) { - double hShift = ui->qsbHorizShift->rawValue(); - double vShift = ui->qsbVertShift->rawValue(); - double rotate = ui->qsbRotate->rawValue(); - double extendBy = ui->qsbExtend->rawValue(); - cl->setShifts(hShift, vShift); - cl->setExtend(extendBy); - cl->setRotate(rotate); - cl->m_flip2Line = false; - App::Color ac; - ac.setValue(ui->cpLineColor->color()); - cl->m_format.m_color = ac; - cl->m_format.m_weight = ui->dsbWeight->value().getValue(); - cl->m_format.m_style = ui->cboxStyle->currentIndex() + 1; //Qt Styles start at 0:NoLine - cl->m_format.m_visible = true; - m_partFeat->addCenterLine(cl); - } else { + if (cl == nullptr) { Base::Console().Log("TCL::createCenterLine - CenterLine creation failed!\n"); Gui::Command::abortCommand(); return; } + double hShift = ui->qsbHorizShift->rawValue(); + double vShift = ui->qsbVertShift->rawValue(); + double rotate = ui->qsbRotate->rawValue(); + double extendBy = ui->qsbExtend->rawValue(); + cl->setShifts(hShift, vShift); + cl->setExtend(extendBy); + cl->setRotate(rotate); + cl->m_flip2Line = false; + App::Color ac; + ac.setValue(ui->cpLineColor->color()); + cl->m_format.m_color = ac; + cl->m_format.m_weight = ui->dsbWeight->value().getValue(); + cl->m_format.m_style = ui->cboxStyle->currentIndex() + 1; //Qt Styles start at 0:NoLine + cl->m_format.m_visible = true; + m_partFeat->addCenterLine(cl); + m_partFeat->recomputeFeature(); Gui::Command::updateActive(); Gui::Command::commitCommand();