From 2ecc125497fdbbec42eb4e5cd1dc3f014f95197f Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Tue, 29 Mar 2022 12:37:00 -0500 Subject: [PATCH] Part: PR6497 move return statement to new line --- src/Mod/Part/App/Attacher.cpp | 3 +- src/Mod/Part/App/PartFeature.cpp | 6 +- src/Mod/Part/App/PartFeatures.cpp | 6 +- src/Mod/Part/App/PropertyTopoShape.cpp | 3 +- src/Mod/Part/App/TopoShape.cpp | 3 +- src/Mod/Part/App/TopoShapePyImp.cpp | 3 +- src/Mod/Part/App/modelRefine.cpp | 24 ++++-- src/Mod/Part/Gui/Command.cpp | 6 +- src/Mod/Part/Gui/DlgBooleanOperation.cpp | 12 ++- src/Mod/Part/Gui/DlgExtrusion.cpp | 3 +- src/Mod/Part/Gui/DlgFilletEdges.cpp | 3 +- src/Mod/Part/Gui/DlgProjectionOnSurface.cpp | 93 ++++++++++++++------- src/Mod/Part/Gui/DlgRevolution.cpp | 3 +- src/Mod/Part/Gui/Mirroring.cpp | 6 +- src/Mod/Part/Gui/SoBrepFaceSet.cpp | 18 ++-- src/Mod/Part/Gui/SoFCShapeObject.cpp | 12 ++- src/Mod/Part/Gui/TaskAttacher.cpp | 9 +- src/Mod/Part/Gui/TaskLoft.cpp | 3 +- src/Mod/Part/Gui/TaskShapeBuilder.cpp | 3 +- src/Mod/Part/Gui/TaskSweep.cpp | 3 +- src/Mod/Part/Gui/ViewProvider2DObject.cpp | 3 +- 21 files changed, 150 insertions(+), 75 deletions(-) diff --git a/src/Mod/Part/App/Attacher.cpp b/src/Mod/Part/App/Attacher.cpp index 34a7e09f50..ede1359034 100644 --- a/src/Mod/Part/App/Attacher.cpp +++ b/src/Mod/Part/App/Attacher.cpp @@ -433,7 +433,8 @@ eRefType AttachEngine::getShapeType(const TopoDS_Shape& sh) case TopAbs_COMPOUND:{ const TopoDS_Compound &cmpd = TopoDS::Compound(sh); TopoDS_Iterator it (cmpd, Standard_False, Standard_False);//don't mess with placements, to hopefully increase speed - if (! it.More()) return rtAnything;//empty compound + if (! it.More())//empty compound + return rtAnything; const TopoDS_Shape &sh1 = it.Value(); it.Next(); if (it.More()){ diff --git a/src/Mod/Part/App/PartFeature.cpp b/src/Mod/Part/App/PartFeature.cpp index 87405b6c74..9d43c9ef66 100644 --- a/src/Mod/Part/App/PartFeature.cpp +++ b/src/Mod/Part/App/PartFeature.cpp @@ -287,7 +287,8 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna { TopoShape shape; - if(!obj) return shape; + if(!obj) + return shape; PyObject *pyobj = nullptr; Base::Matrix4D mat; @@ -526,7 +527,8 @@ TopoShape Feature::getTopoShape(const App::DocumentObject *obj, const char *subn App::DocumentObject *Feature::getShapeOwner(const App::DocumentObject *obj, const char *subname) { - if(!obj) return nullptr; + if(!obj) + return nullptr; auto owner = obj->getSubObject(subname); if(owner) { auto linked = owner->getLinkedObject(true); diff --git a/src/Mod/Part/App/PartFeatures.cpp b/src/Mod/Part/App/PartFeatures.cpp index a25d607cc6..9e597d9d42 100644 --- a/src/Mod/Part/App/PartFeatures.cpp +++ b/src/Mod/Part/App/PartFeatures.cpp @@ -117,12 +117,14 @@ App::DocumentObjectExecReturn *RuledSurface::execute(void) // get the first input shape TopoDS_Shape S1; ret = getShape(Curve1, S1); - if (ret) return ret; + if (ret) + return ret; // get the second input shape TopoDS_Shape S2; ret = getShape(Curve2, S2); - if (ret) return ret; + if (ret) + return ret; // check for expected type if (S1.IsNull() || S2.IsNull()) diff --git a/src/Mod/Part/App/PropertyTopoShape.cpp b/src/Mod/Part/App/PropertyTopoShape.cpp index d8bbae2222..8b2edaee53 100644 --- a/src/Mod/Part/App/PropertyTopoShape.cpp +++ b/src/Mod/Part/App/PropertyTopoShape.cpp @@ -243,7 +243,8 @@ static Standard_Boolean BRepTools_Write(const TopoDS_Shape& Sh, const Standard_ #else os.open(File, std::ios::out); #endif - if (!os.rdbuf()->is_open()) return Standard_False; + if (!os.rdbuf()->is_open()) + return Standard_False; Standard_Boolean isGood = (os.good() && !os.eof()); if(!isGood) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index cfc3833c9f..115dd625aa 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -395,7 +395,8 @@ TopoDS_Shape TopoShape::getSubShape(TopAbs_ShapeEnum type, int index, bool silen unsigned long TopoShape::countSubShapes(const char* Type) const { - if(!Type) return 0; + if(!Type) + return 0; if(strcmp(Type,"SubShape")==0) return countSubShapes(TopAbs_SHAPE); auto type = shapeType(Type,true); diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index e4b8a7d95a..d44665c68e 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -3245,7 +3245,8 @@ Py::Float TopoShapePy::getVolume(void) const PyObject *TopoShapePy::getCustomAttributes(const char* attr) const { - if (!attr) return nullptr; + if (!attr) + return nullptr; PY_TRY { TopoDS_Shape res = getTopoShapePtr()->getSubShape(attr,true); if(!res.IsNull()) diff --git a/src/Mod/Part/App/modelRefine.cpp b/src/Mod/Part/App/modelRefine.cpp index 90dabaea99..a51135f3e4 100644 --- a/src/Mod/Part/App/modelRefine.cpp +++ b/src/Mod/Part/App/modelRefine.cpp @@ -826,14 +826,22 @@ bool FaceTypedBSpline::isEqual(const TopoDS_Face &faceOne, const TopoDS_Face &fa if (surfaceOne.IsNull() || surfaceTwo.IsNull()) return false; - if (surfaceOne->IsURational() != surfaceTwo->IsURational()) return false; - if (surfaceOne->IsVRational() != surfaceTwo->IsVRational()) return false; - if (surfaceOne->IsUPeriodic() != surfaceTwo->IsUPeriodic()) return false; - if (surfaceOne->IsVPeriodic() != surfaceTwo->IsVPeriodic()) return false; - if (surfaceOne->IsUClosed() != surfaceTwo->IsUClosed()) return false; - if (surfaceOne->IsVClosed() != surfaceTwo->IsVClosed()) return false; - if (surfaceOne->UDegree() != surfaceTwo->UDegree()) return false; - if (surfaceOne->VDegree() != surfaceTwo->VDegree()) return false; + if (surfaceOne->IsURational() != surfaceTwo->IsURational()) + return false; + if (surfaceOne->IsVRational() != surfaceTwo->IsVRational()) + return false; + if (surfaceOne->IsUPeriodic() != surfaceTwo->IsUPeriodic()) + return false; + if (surfaceOne->IsVPeriodic() != surfaceTwo->IsVPeriodic()) + return false; + if (surfaceOne->IsUClosed() != surfaceTwo->IsUClosed()) + return false; + if (surfaceOne->IsVClosed() != surfaceTwo->IsVClosed()) + return false; + if (surfaceOne->UDegree() != surfaceTwo->UDegree()) + return false; + if (surfaceOne->VDegree() != surfaceTwo->VDegree()) + return false; //pole test int uPoleCountOne(surfaceOne->NbUPoles()); diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index e98a4d845d..e5916ebace 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -1004,7 +1004,8 @@ void CmdPartImport::activated(int iMsg) if (!fn.isEmpty()) { Gui::WaitCursor wc; App::Document* pDoc = getDocument(); - if (!pDoc) return; // no document + if (!pDoc) // no document + return; fn = Base::Tools::escapeEncodeFilename(fn); openCommand(QT_TRANSLATE_NOOP("Command", "Import Part")); @@ -1065,7 +1066,8 @@ void CmdPartExport::activated(int iMsg) QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;")), &select); if (!fn.isEmpty()) { App::Document* pDoc = getDocument(); - if (!pDoc) return; // no document + if (!pDoc) // no document + return; if (select == filter[1] || select == filter[3]) { Gui::Application::Instance->exportTo((const char*)fn.toUtf8(),pDoc->getName(),"ImportGui"); diff --git a/src/Mod/Part/Gui/DlgBooleanOperation.cpp b/src/Mod/Part/Gui/DlgBooleanOperation.cpp index 7c927ad693..5479fc58e6 100644 --- a/src/Mod/Part/Gui/DlgBooleanOperation.cpp +++ b/src/Mod/Part/Gui/DlgBooleanOperation.cpp @@ -62,7 +62,8 @@ namespace PartGui { QTreeWidgetItem::setData(column, role, value); if (role == Qt::CheckStateRole && value.toBool() == true) { QTreeWidget* tree = this->treeWidget(); - if (!tree) return; + if (!tree) + return; int numChild = tree->topLevelItemCount(); for (int i=0; itopLevelItem(i); @@ -117,7 +118,8 @@ void DlgBooleanOperation::changeEvent(QEvent *e) void DlgBooleanOperation::slotCreatedObject(const App::DocumentObject& obj) { App::Document* activeDoc = App::GetApplication().getActiveDocument(); - if (!activeDoc) return; + if (!activeDoc) + return; App::Document* doc = obj.getDocument(); if (activeDoc == doc && obj.getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { observe.push_back(&obj); @@ -205,9 +207,11 @@ bool DlgBooleanOperation::hasSolids(const App::DocumentObject* obj) const void DlgBooleanOperation::findShapes() { App::Document* activeDoc = App::GetApplication().getActiveDocument(); - if (!activeDoc) return; + if (!activeDoc) + return; Gui::Document* activeGui = Gui::Application::Instance->getDocument(activeDoc); - if (!activeGui) return; + if (!activeGui) + return; std::vector objs = activeDoc->getObjectsOfType (Part::Feature::getClassTypeId()); diff --git a/src/Mod/Part/Gui/DlgExtrusion.cpp b/src/Mod/Part/Gui/DlgExtrusion.cpp index 00e0b2fadb..1d8a610b8e 100644 --- a/src/Mod/Part/Gui/DlgExtrusion.cpp +++ b/src/Mod/Part/Gui/DlgExtrusion.cpp @@ -346,7 +346,8 @@ void DlgExtrusion::autoSolid() void DlgExtrusion::findShapes() { App::Document* activeDoc = App::GetApplication().getActiveDocument(); - if (!activeDoc) return; + if (!activeDoc) + return; Gui::Document* activeGui = Gui::Application::Instance->getDocument(activeDoc); this->document = activeDoc->getName(); this->label = activeDoc->Label.getValue(); diff --git a/src/Mod/Part/Gui/DlgFilletEdges.cpp b/src/Mod/Part/Gui/DlgFilletEdges.cpp index c5deed8d9a..db9ce6e7dc 100644 --- a/src/Mod/Part/Gui/DlgFilletEdges.cpp +++ b/src/Mod/Part/Gui/DlgFilletEdges.cpp @@ -528,7 +528,8 @@ void DlgFilletEdges::toggleCheckState(const QModelIndex& index) void DlgFilletEdges::findShapes() { App::Document* activeDoc = App::GetApplication().getActiveDocument(); - if (!activeDoc) return; + if (!activeDoc) + return; std::vector objs = activeDoc->getObjectsOfType (Part::Feature::getClassTypeId()); diff --git a/src/Mod/Part/Gui/DlgProjectionOnSurface.cpp b/src/Mod/Part/Gui/DlgProjectionOnSurface.cpp index 4934565cec..b6f8847314 100644 --- a/src/Mod/Part/Gui/DlgProjectionOnSurface.cpp +++ b/src/Mod/Part/Gui/DlgProjectionOnSurface.cpp @@ -86,15 +86,20 @@ public: bool allow(App::Document* /*pDoc*/, App::DocumentObject* iPObj, const char* sSubName) { Part::Feature* aPart = dynamic_cast(iPObj); - if (!aPart) return false; - if (!sSubName) return false; + if (!aPart) + return false; + if (!sSubName) + return false; std::string subName(sSubName); - if (subName.empty()) return false; + if (subName.empty()) + return false; auto subShape = aPart->Shape.getShape().getSubShape(sSubName); - if (subShape.IsNull()) return false; + if (subShape.IsNull()) + return false; auto type = subShape.ShapeType(); - if (type != TopAbs_EDGE) return false; + if (type != TopAbs_EDGE) + return false; return true; } }; @@ -115,15 +120,20 @@ public: bool allow(App::Document* /*pDoc*/, App::DocumentObject* iPObj, const char* sSubName) { Part::Feature* aPart = dynamic_cast(iPObj); - if (!aPart) return false; - if (!sSubName) return false; + if (!aPart) + return false; + if (!sSubName) + return false; std::string subName(sSubName); - if (subName.empty()) return false; + if (subName.empty()) + return false; auto subShape = aPart->Shape.getShape().getSubShape(sSubName, true); - if (subShape.IsNull()) return false; + if (subShape.IsNull()) + return false; auto type = subShape.ShapeType(); - if (type != TopAbs_FACE) return false; + if (type != TopAbs_FACE) + return false; return true; } }; @@ -333,7 +343,8 @@ void PartGui::DlgProjectionOnSurface::get_camera_direction(void) auto mainWindow = Gui::getMainWindow(); auto mdiObject = dynamic_cast(mainWindow->activeWindow()); - if (!mdiObject) return; + if (!mdiObject) + return; auto camerRotation = mdiObject->getViewer()->getCameraOrientation(); SbVec3f lookAt(0, 0, -1); @@ -349,7 +360,8 @@ void PartGui::DlgProjectionOnSurface::get_camera_direction(void) void PartGui::DlgProjectionOnSurface::store_current_selected_parts(std::vector& iStoreVec, const unsigned int iColor) { - if (!m_partDocument) return; + if (!m_partDocument) + return; std::vector selObj = Gui::Selection().getSelectionEx(); if (selObj.size()) { @@ -402,7 +414,8 @@ void PartGui::DlgProjectionOnSurface::store_current_selected_parts(std::vector& iStoreVec) { - if (iCurrentShape.inputShape.IsNull()) return false; + if (iCurrentShape.inputShape.IsNull()) + return false; auto currentType = iCurrentShape.inputShape.ShapeType(); for ( auto it = iStoreVec.begin(); it != iStoreVec.end(); ++it) { @@ -450,7 +463,8 @@ void PartGui::DlgProjectionOnSurface::create_projection_wire(std::vector& iShapeVec) { - if (iShapeVec.empty()) return TopoDS_Shape(); + if (iShapeVec.empty()) + return TopoDS_Shape(); TopoDS_Compound aCompound; TopoDS_Builder aBuilder; @@ -581,11 +596,13 @@ TopoDS_Shape PartGui::DlgProjectionOnSurface::create_compound(const std::vector< void PartGui::DlgProjectionOnSurface::show_projected_shapes(const std::vector& iShapeStoreVec) { - if (!m_projectionObject) return; + if (!m_projectionObject) + return; auto aCompound = create_compound(iShapeStoreVec); if ( aCompound.IsNull() ) { - if (!m_partDocument) return; + if (!m_partDocument) + return; m_projectionObject->Shape.setValue(TopoDS_Shape()); return; } @@ -625,7 +642,8 @@ void PartGui::DlgProjectionOnSurface::enable_ui_elements(const std::vectorShape.getShape().getShape(); auto subShape = iCurrentObject->Shape.getShape().getSubShape(iShapeName.c_str(), true); @@ -635,8 +653,10 @@ void PartGui::DlgProjectionOnSurface::higlight_object(Part::Feature* iCurrentObj auto currentShapeType = currentShape.ShapeType(); TopTools_IndexedMapOfShape anIndices; TopExp::MapShapes(partenShape, currentShapeType, anIndices); - if (anIndices.IsEmpty()) return; - if (!anIndices.Contains(currentShape)) return; + if (anIndices.IsEmpty()) + return; + if (!anIndices.Contains(currentShape)) + return; auto index = anIndices.FindIndex(currentShape); //set color @@ -698,7 +718,8 @@ void PartGui::DlgProjectionOnSurface::create_projection_face_from_wire(std::vect { try { - if (iCurrentShape.empty()) return; + if (iCurrentShape.empty()) + return; for ( auto &itCurrentShape : iCurrentShape ) { @@ -813,7 +834,8 @@ TopoDS_Wire PartGui::DlgProjectionOnSurface::sort_and_heal_wire(const std::vecto shapeAnalyzer.ConnectEdgesToWires(shapeList, 0.0001, false, aWireHandle); shapeAnalyzer.ConnectWiresToWires(aWireHandle, 0.0001, false, aWireWireHandle); - if (!aWireWireHandle) return TopoDS_Wire(); + if (!aWireWireHandle) + return TopoDS_Wire(); for (auto it = 1; it <= aWireWireHandle->Length(); ++it) { auto aShape = TopoDS::Wire(aWireWireHandle->Value(it)); @@ -835,7 +857,8 @@ void PartGui::DlgProjectionOnSurface::create_face_extrude(std::vector& iStoreVec, const unsigned int iColor) { - if (m_currentSelection != "add_wire") return; - if (iParentShape.IsNull()) return; - if (iCurrentShape.inputShape.IsNull()) return; + if (m_currentSelection != "add_wire") + return; + if (iParentShape.IsNull()) + return; + if (iCurrentShape.inputShape.IsNull()) + return; auto currentType = iCurrentShape.inputShape.ShapeType(); - if (currentType != TopAbs_EDGE) return; + if (currentType != TopAbs_EDGE) + return; std::vector aWireVec; for (TopExp_Explorer aExplorer(iParentShape, TopAbs_WIRE); aExplorer.More(); aExplorer.Next()) @@ -888,15 +916,18 @@ void PartGui::DlgProjectionOnSurface::store_wire_in_vector(const SShapeStore& iC edgeVec.clear(); } - if (edgeVec.empty()) return; + if (edgeVec.empty()) + return; TopTools_IndexedMapOfShape indexMap; TopExp::MapShapes(iParentShape, TopAbs_EDGE, indexMap); - if (indexMap.IsEmpty()) return; + if (indexMap.IsEmpty()) + return; for ( auto it : edgeVec ) { if ( it.IsSame(iCurrentShape.inputShape)) continue; - if (!indexMap.Contains(it)) return; + if (!indexMap.Contains(it)) + return; auto index = indexMap.FindIndex(it); auto newEdgeObject = iCurrentShape; newEdgeObject.inputShape = it; diff --git a/src/Mod/Part/Gui/DlgRevolution.cpp b/src/Mod/Part/Gui/DlgRevolution.cpp index 1f27449f57..61ab1a62fa 100644 --- a/src/Mod/Part/Gui/DlgRevolution.cpp +++ b/src/Mod/Part/Gui/DlgRevolution.cpp @@ -323,7 +323,8 @@ void DlgRevolution::keyPressEvent(QKeyEvent* ke) void DlgRevolution::findShapes() { App::Document* activeDoc = App::GetApplication().getActiveDocument(); - if (!activeDoc) return; + if (!activeDoc) + return; Gui::Document* activeGui = Gui::Application::Instance->getDocument(activeDoc); std::vector objs = activeDoc->getObjectsOfType diff --git a/src/Mod/Part/Gui/Mirroring.cpp b/src/Mod/Part/Gui/Mirroring.cpp index babb050620..c3adead1e0 100644 --- a/src/Mod/Part/Gui/Mirroring.cpp +++ b/src/Mod/Part/Gui/Mirroring.cpp @@ -89,9 +89,11 @@ void Mirroring::changeEvent(QEvent *e) void Mirroring::findShapes() { App::Document* activeDoc = App::GetApplication().getActiveDocument(); - if (!activeDoc) return; + if (!activeDoc) + return; Gui::Document* activeGui = Gui::Application::Instance->getDocument(activeDoc); - if (!activeGui) return; + if (!activeGui) + return; this->document = QString::fromLatin1(activeDoc->getName()); std::vector objs = activeDoc->getObjectsOfType diff --git a/src/Mod/Part/Gui/SoBrepFaceSet.cpp b/src/Mod/Part/Gui/SoBrepFaceSet.cpp index 4a93c115c4..b716daa39d 100644 --- a/src/Mod/Part/Gui/SoBrepFaceSet.cpp +++ b/src/Mod/Part/Gui/SoBrepFaceSet.cpp @@ -459,7 +459,8 @@ void SoBrepFaceSet::GLRender(SoGLRenderAction *action) void SoBrepFaceSet::renderSimpleArray() { int cnt = index_array.size(); - if (cnt == 0) return; + if (cnt == 0) + return; glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); @@ -485,7 +486,8 @@ void SoBrepFaceSet::renderColoredArray(SoMaterialBundle *const materials) { int num_parts = partIndex.getNum(); int cnt = index_array.size(); - if (cnt == 0) return; + if (cnt == 0) + return; glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); @@ -687,19 +689,22 @@ void SoBrepFaceSet::GLRender(SoGLRenderAction *action) #endif bool SoBrepFaceSet::overrideMaterialBinding(SoGLRenderAction *action, SelContextPtr ctx, SelContextPtr ctx2) { - if(!ctx && !ctx2) return false; + if(!ctx && !ctx2) + return false; auto state = action->getState(); auto mb = SoMaterialBindingElement::get(state); auto element = SoLazyElement::getInstance(state); const SbColor *diffuse = element->getDiffusePointer(); - if(!diffuse) return false; + if(!diffuse) + return false; int diffuse_size = element->getNumDiffuse(); const float *trans = element->getTransparencyPointer(); int trans_size = element->getNumTransparencies(); - if(!trans || !trans_size) return false; + if(!trans || !trans_size) + return false; float trans0=0.0; bool hasTransparency = false; for(int i=0;icoordIndex.getNum() < 3) return; + if (this->coordIndex.getNum() < 3) + return; SoState * state = action->getState(); if (this->vertexProperty.getValue()) { diff --git a/src/Mod/Part/Gui/SoFCShapeObject.cpp b/src/Mod/Part/Gui/SoFCShapeObject.cpp index b50fa52274..b5a4d7fbe1 100644 --- a/src/Mod/Part/Gui/SoFCShapeObject.cpp +++ b/src/Mod/Part/Gui/SoFCShapeObject.cpp @@ -81,9 +81,11 @@ void SoFCControlPoints::GLRender(SoGLRenderAction *action) { SoState* state = action->getState(); const SoCoordinateElement * coords = SoCoordinateElement::getInstance(state); - if (!coords) return; + if (!coords) + return; const SbVec3f * points = coords->getArrayPtr3(); - if (!points) return; + if (!points) + return; SoMaterialBundle mb(action); SoTextureCoordinateBundle tb(action, true, false); @@ -159,9 +161,11 @@ void SoFCControlPoints::computeBBox(SoAction *action, SbBox3f &box, SbVec3f &cen { SoState* state = action->getState(); const SoCoordinateElement * coords = SoCoordinateElement::getInstance(state); - if (!coords) return; + if (!coords) + return; const SbVec3f * points = coords->getArrayPtr3(); - if (!points) return; + if (!points) + return; float maxX=-FLT_MAX, minX=FLT_MAX, maxY=-FLT_MAX, minY=FLT_MAX, maxZ=-FLT_MAX, minZ=FLT_MAX; diff --git a/src/Mod/Part/Gui/TaskAttacher.cpp b/src/Mod/Part/Gui/TaskAttacher.cpp index 14884c2e23..9405a7e995 100644 --- a/src/Mod/Part/Gui/TaskAttacher.cpp +++ b/src/Mod/Part/Gui/TaskAttacher.cpp @@ -365,7 +365,8 @@ void TaskAttacher::onSelectionChanged(const Gui::SelectionChanges& msg) std::vector refs = pcAttach->Support.getValues(); std::vector refnames = pcAttach->Support.getSubValues(); App::DocumentObject* selObj = ViewProvider->getObject()->getDocument()->getObject(msg.pObjectName); - if (!selObj || selObj == ViewProvider->getObject()) return;//prevent self-referencing + if (!selObj || selObj == ViewProvider->getObject())//prevent self-referencing + return; std::string subname = msg.pSubName; @@ -563,7 +564,8 @@ void TaskAttacher::onRefName(const QString& text, unsigned idx) return; QLineEdit* line = getLine(idx); - if (line == nullptr) return; + if (line == nullptr) + return; if (text.length() == 0) { // Reference was removed @@ -606,7 +608,8 @@ void TaskAttacher::onRefName(const QString& text, unsigned idx) parts.push_back(QString::fromLatin1("")); // Check whether this is the name of an App::Plane or Part::Datum feature App::DocumentObject* obj = ViewProvider->getObject()->getDocument()->getObject(parts[0].toLatin1()); - if (obj == nullptr) return; + if (obj == nullptr) + return; std::string subElement; diff --git a/src/Mod/Part/Gui/TaskLoft.cpp b/src/Mod/Part/Gui/TaskLoft.cpp index 181ee8baa7..8ad5edf8a0 100644 --- a/src/Mod/Part/Gui/TaskLoft.cpp +++ b/src/Mod/Part/Gui/TaskLoft.cpp @@ -98,7 +98,8 @@ void LoftWidget::findShapes() { App::Document* activeDoc = App::GetApplication().getActiveDocument(); Gui::Document* activeGui = Gui::Application::Instance->getDocument(activeDoc); - if (!activeGui) return; + if (!activeGui) + return; d->document = activeDoc->getName(); std::vector objs = activeDoc->getObjectsOfType(); diff --git a/src/Mod/Part/Gui/TaskShapeBuilder.cpp b/src/Mod/Part/Gui/TaskShapeBuilder.cpp index 765f6d0ed5..1fe74024eb 100644 --- a/src/Mod/Part/Gui/TaskShapeBuilder.cpp +++ b/src/Mod/Part/Gui/TaskShapeBuilder.cpp @@ -172,7 +172,8 @@ void ShapeBuilderWidget::on_createButton_clicked() { int mode = d->bg.checkedId(); Gui::Document* doc = Gui::Application::Instance->activeDocument(); - if (!doc) return; + if (!doc) + return; try { if (mode == 0) { diff --git a/src/Mod/Part/Gui/TaskSweep.cpp b/src/Mod/Part/Gui/TaskSweep.cpp index 31552a94bd..ce676c0eca 100644 --- a/src/Mod/Part/Gui/TaskSweep.cpp +++ b/src/Mod/Part/Gui/TaskSweep.cpp @@ -155,7 +155,8 @@ void SweepWidget::findShapes() { App::Document* activeDoc = App::GetApplication().getActiveDocument(); Gui::Document* activeGui = Gui::Application::Instance->getDocument(activeDoc); - if (!activeGui) return; + if (!activeGui) + return; d->document = activeDoc->getName(); std::vector objs = activeDoc->getObjectsOfType(); diff --git a/src/Mod/Part/Gui/ViewProvider2DObject.cpp b/src/Mod/Part/Gui/ViewProvider2DObject.cpp index c5ad6b8484..661cc1c876 100644 --- a/src/Mod/Part/Gui/ViewProvider2DObject.cpp +++ b/src/Mod/Part/Gui/ViewProvider2DObject.cpp @@ -246,7 +246,8 @@ void ViewProvider2DObjectGrid::updateData(const App::Property* prop) if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId()) { if (GridAutoSize.getValue()) { Base::BoundBox3d bbox = static_cast(prop)->getBoundingBox(); - if (!bbox.IsValid()) return; + if (!bbox.IsValid()) + return; Gui::coinRemoveAllChildren(GridRoot); Base::Placement place = static_cast(prop)->getComplexData()->getPlacement(); place.invert();