diff --git a/src/Mod/Sketcher/App/ExternalGeometryExtension.cpp b/src/Mod/Sketcher/App/ExternalGeometryExtension.cpp index 5beb6ff770..00934fee9f 100644 --- a/src/Mod/Sketcher/App/ExternalGeometryExtension.cpp +++ b/src/Mod/Sketcher/App/ExternalGeometryExtension.cpp @@ -84,7 +84,8 @@ bool ExternalGeometryExtension::getFlagsFromName(std::string str, ExternalGeomet auto pos = std::find_if( ExternalGeometryExtension::flag2str.begin(), ExternalGeometryExtension::flag2str.end(), [str](const char * val) { - return strcmp(val,str.c_str())==0;} + return strcmp(val,str.c_str())==0; + } ); if( pos != ExternalGeometryExtension::flag2str.end()) { diff --git a/src/Mod/Sketcher/App/ExternalGeometryFacadePyImp.cpp b/src/Mod/Sketcher/App/ExternalGeometryFacadePyImp.cpp index c2375823f1..c71f365c52 100644 --- a/src/Mod/Sketcher/App/ExternalGeometryFacadePyImp.cpp +++ b/src/Mod/Sketcher/App/ExternalGeometryFacadePyImp.cpp @@ -115,7 +115,8 @@ PyObject* ExternalGeometryFacadePy::setFlag(PyObject *args) auto pos = std::find_if(ExternalGeometryExtension::flag2str.begin(), ExternalGeometryExtension::flag2str.end(), [flag](const char * val) { - return strcmp(val,flag)==0;} + return strcmp(val,flag)==0; + } ); if( pos != ExternalGeometryExtension::flag2str.end()) { diff --git a/src/Mod/Sketcher/App/SketchGeometryExtension.cpp b/src/Mod/Sketcher/App/SketchGeometryExtension.cpp index 939203d274..8e8081410d 100644 --- a/src/Mod/Sketcher/App/SketchGeometryExtension.cpp +++ b/src/Mod/Sketcher/App/SketchGeometryExtension.cpp @@ -114,7 +114,8 @@ bool SketchGeometryExtension::getInternalTypeFromName(std::string str, InternalT auto pos = std::find_if( SketchGeometryExtension::internaltype2str.begin(), SketchGeometryExtension::internaltype2str.end(), [str](const char * val) { - return strcmp(val,str.c_str())==0;} + return strcmp(val,str.c_str())==0; + } ); if( pos != SketchGeometryExtension::internaltype2str.end()) { @@ -132,7 +133,8 @@ bool SketchGeometryExtension::getGeometryModeFromName(std::string str, GeometryM auto pos = std::find_if( SketchGeometryExtension::geometrymode2str.begin(), SketchGeometryExtension::geometrymode2str.end(), [str](const char * val) { - return strcmp(val,str.c_str())==0;} + return strcmp(val,str.c_str())==0; + } ); if( pos != SketchGeometryExtension::geometrymode2str.end()) { diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 9f2d2e7991..7f3830c41d 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -1807,7 +1807,8 @@ int SketchObject::fillet(int GeoId1, int GeoId2, int filletId; std::unique_ptr arc( Part::createFilletGeometry(lineSeg1, lineSeg2, filletCenter, radius)); - if (!arc) return -1; + if (!arc) + return -1; // calculate intersection and distances before we invalidate lineSeg1 and lineSeg2 if (!find2DLinesIntersection(lineSeg1, lineSeg2, intersection)) { diff --git a/src/Mod/Sketcher/App/planegcs/Constraints.cpp b/src/Mod/Sketcher/App/planegcs/Constraints.cpp index e28c3ad8d7..c1102aac76 100644 --- a/src/Mod/Sketcher/App/planegcs/Constraints.cpp +++ b/src/Mod/Sketcher/App/planegcs/Constraints.cpp @@ -560,7 +560,8 @@ double ConstraintPointOnPerpBisector::error() double ConstraintPointOnPerpBisector::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); @@ -1102,7 +1103,8 @@ double ConstraintEllipseTangentLine::error() double ConstraintEllipseTangentLine::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); @@ -1228,7 +1230,8 @@ double ConstraintInternalAlignmentPoint2Ellipse::error() double ConstraintInternalAlignmentPoint2Ellipse::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); @@ -1361,7 +1364,8 @@ double ConstraintInternalAlignmentPoint2Hyperbola::error() double ConstraintInternalAlignmentPoint2Hyperbola::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); @@ -1423,7 +1427,8 @@ double ConstraintEqualMajorAxesConic::error() double ConstraintEqualMajorAxesConic::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); @@ -1499,7 +1504,8 @@ double ConstraintEqualFocalDistance::error() double ConstraintEqualFocalDistance::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); @@ -1587,7 +1593,8 @@ double ConstraintCurveValue::error() double ConstraintCurveValue::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); @@ -1814,7 +1821,8 @@ double ConstraintPointOnParabola::error() double ConstraintPointOnParabola::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); @@ -1884,7 +1892,8 @@ double ConstraintAngleViaPoint::error() double ConstraintAngleViaPoint::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv=0.; @@ -2000,7 +2009,8 @@ double ConstraintSnell::grad(double *param) { //first of all, check that we need to compute anything. - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); @@ -2117,7 +2127,8 @@ double ConstraintEqualLineLength::error() double ConstraintEqualLineLength::grad(double *param) { - if ( findParamInPvec(param) == -1 ) return 0.0; + if ( findParamInPvec(param) == -1 ) + return 0.0; double deriv; errorgrad(nullptr, &deriv, param); diff --git a/src/Mod/Sketcher/Gui/Command.cpp b/src/Mod/Sketcher/Gui/Command.cpp index d88e826657..ef3221bb9e 100644 --- a/src/Mod/Sketcher/Gui/Command.cpp +++ b/src/Mod/Sketcher/Gui/Command.cpp @@ -181,7 +181,8 @@ void CmdSketcherNewSketch::activated(int iMsg) qApp->translate("Sketcher_NewSketch", "Sketch attachment"), qApp->translate("Sketcher_NewSketch", "Select the method to attach this sketch to selected object"), items, iSugg, false, &ok, Qt::MSWindowsFixedSizeDialogHint); - if (!ok) return; + if (!ok) + return; int index = items.indexOf(text); if (index == 0){ bAttach = false; diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 1dea34d355..ffe9002c73 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -6885,7 +6885,8 @@ void CmdSketcherConstrainSnellsLaw::activated(int iMsg) ui_Datum.labelEdit->setSingleStep(0.05); // Unable to bind, because the constraint does not yet exist - if (dlg.exec() != QDialog::Accepted) return; + if (dlg.exec() != QDialog::Accepted) + return; ui_Datum.labelEdit->pushToHistory(); Base::Quantity newQuant = ui_Datum.labelEdit->value(); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp index 8349c209c0..3e7d10c233 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp @@ -598,7 +598,8 @@ int DrawSketchHandler::seekAutoConstraint(std::vector &suggested suggestedConstraints.push_back(constr); // Do not seek for tangent if we are actually building a primitive - if (type == AutoConstraint::VERTEX_NO_TANGENCY) return suggestedConstraints.size(); + if (type == AutoConstraint::VERTEX_NO_TANGENCY) + return suggestedConstraints.size(); // Find if there are tangent constraints (currently arcs and circles) diff --git a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp b/src/Mod/Sketcher/Gui/SoDatumLabel.cpp index 944f2819f1..8f0be3b09c 100644 --- a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp +++ b/src/Mod/Sketcher/Gui/SoDatumLabel.cpp @@ -458,7 +458,8 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) } const unsigned char * dataptr = this->image.getValue(imgsize, nc); - if (dataptr == nullptr) return; // no image + if (dataptr == nullptr) // no image + return; srcw = imgsize[0]; srch = imgsize[1]; diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp index 0046b7a483..2a7d1d8d15 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp @@ -583,7 +583,8 @@ void ConstraintView::centerSelectedItems() void ConstraintView::deleteSelectedItems() { App::Document* doc = App::GetApplication().getActiveDocument(); - if (!doc) return; + if (!doc) + return; doc->openTransaction("Delete constraint"); std::vector sel = Gui::Selection().getSelectionEx(doc->getName()); @@ -1139,7 +1140,8 @@ void TaskSketcherConstraints::on_listWidgetConstraints_itemSelectionChanged(void void TaskSketcherConstraints::on_listWidgetConstraints_itemActivated(QListWidgetItem *item) { ConstraintItem *it = dynamic_cast(item); - if (!it) return; + if (!it) + return; // if its the right constraint if (it->isDimensional()) { @@ -1153,7 +1155,8 @@ void TaskSketcherConstraints::on_listWidgetConstraints_updateDrivingStatus(QList { Q_UNUSED(status); ConstraintItem *citem = dynamic_cast(item); - if (!citem) return; + if (!citem) + return; Gui::Application::Instance->commandManager().runCommandByName("Sketcher_ToggleDrivingConstraint"); slotConstraintsChanged(); @@ -1163,7 +1166,8 @@ void TaskSketcherConstraints::on_listWidgetConstraints_updateActiveStatus(QListW { Q_UNUSED(status); ConstraintItem *citem = dynamic_cast(item); - if (!citem) return; + if (!citem) + return; Gui::Application::Instance->commandManager().runCommandByName("Sketcher_ToggleActiveConstraint"); slotConstraintsChanged(); diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp index 1b3199833e..12cbf987c3 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp @@ -224,7 +224,8 @@ CONTEXT_MEMBER_DEF("Sketcher_SelectVerticalAxis",doSelectVAxis) void ElementView::deleteSelectedItems() { App::Document* doc = App::GetApplication().getActiveDocument(); - if (!doc) return; + if (!doc) + return; doc->openTransaction("Delete element"); std::vector sel = Gui::Selection().getSelectionEx(doc->getName()); @@ -614,7 +615,8 @@ void TaskSketcherElements::on_listWidgetElements_itemSelectionChanged(void) void TaskSketcherElements::on_listWidgetElements_itemEntered(QListWidgetItem *item) { ElementItem *it = dynamic_cast(item); - if (!it) return; + if (!it) + return; Gui::Selection().rmvPreselect(); @@ -1162,9 +1164,12 @@ TaskSketcherElements::MultIcon::MultIcon(const char* name) QIcon TaskSketcherElements::MultIcon::getIcon(bool construction, bool external) const { - if (construction && external) return QIcon(); - if (construction) return Construction; - if (external) return External; + if (construction && external) + return QIcon(); + if (construction) + return Construction; + if (external) + return External; return Normal; } diff --git a/src/Mod/Sketcher/Gui/TaskSketcherValidation.cpp b/src/Mod/Sketcher/Gui/TaskSketcherValidation.cpp index 462b721032..c0cda9f54c 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherValidation.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherValidation.cpp @@ -319,7 +319,8 @@ void SketcherValidation::on_delConstrExtr_clicked() tr("Delete constraints to external geom."), tr("You are about to delete ALL constraints that deal with external geometry. This is useful to rescue a sketch with broken/changed links to external geometry. Are you sure you want to delete the constraints?"), QMessageBox::No|QMessageBox::Yes,QMessageBox::No); - if(reply!=QMessageBox::Yes) return; + if(reply!=QMessageBox::Yes) + return; App::Document* doc = sketch->getDocument(); doc->openTransaction("Delete constraints"); diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 1dc00982dc..5d08caf255 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -523,7 +523,8 @@ void ViewProviderSketch::getProjectingLine(const SbVec2s& pnt, const Gui::View3D } SoCamera* pCam = viewer->getSoRenderManager()->getCamera(); - if (!pCam) return; + if (!pCam) + return; SbViewVolume vol = pCam->getViewVolume(); vol.projectPointToLine(SbVec2f(pX,pY), line);