From e13c09235f16cc6483962dbf56484ba219926eb9 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 30 Jul 2018 10:28:54 -0700 Subject: [PATCH] Changed all catch types to references for polymorphic exceptions. --- .../src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp | 2 +- .../salomesmesh/src/SMESH/SMESH_Algo.cpp | 2 +- .../salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp | 2 +- .../src/SMESH/SMESH_MeshEditor.cpp | 2 +- .../src/SMESH/SMESH_MesherHelper.cpp | 6 ++--- .../salomesmesh/src/SMESHDS/SMESHDS_Mesh.cpp | 2 +- .../StdMeshers_CompositeHexa_3D.cpp | 2 +- .../StdMeshers/StdMeshers_Distribution.cpp | 8 +++--- .../StdMeshers_NumberOfSegments.cpp | 4 +-- src/App/PropertyLinks.cpp | 2 +- src/Mod/Drawing/App/DrawingExport.cpp | 8 +++--- .../Drawing/App/FeatureViewSpreadsheet.cpp | 2 +- src/Mod/Drawing/Gui/TaskOrthoViews.cpp | 2 +- src/Mod/Fem/App/FemConstraint.cpp | 2 +- src/Mod/Fem/App/FemTools.cpp | 16 ++++++------ src/Mod/Part/App/AppPartPy.cpp | 26 +++++++++---------- src/Mod/Part/App/ArcOfConicPyImp.cpp | 6 ++--- src/Mod/Part/App/AttachEnginePyImp.cpp | 2 +- src/Mod/Part/App/AttachExtension.cpp | 2 +- src/Mod/Part/App/AttachExtensionPyImp.cpp | 2 +- src/Mod/Part/App/Attacher.cpp | 2 +- src/Mod/Part/App/ConePyImp.cpp | 2 +- src/Mod/Part/App/ConicPyImp.cpp | 6 ++--- src/Mod/Part/App/CylinderPyImp.cpp | 2 +- src/Mod/Part/App/FeaturePartBoolean.cpp | 2 +- src/Mod/Part/App/FeaturePartCommon.cpp | 2 +- src/Mod/Part/App/FeaturePartFuse.cpp | 2 +- src/Mod/Part/App/Geometry.cpp | 2 +- src/Mod/Part/App/PlanePyImp.cpp | 2 +- src/Mod/Part/App/PropertyTopoShape.cpp | 2 +- src/Mod/Part/App/SpherePyImp.cpp | 2 +- src/Mod/Part/App/TopoShape.cpp | 4 +-- src/Mod/Part/App/TopoShapePyImp.cpp | 2 +- src/Mod/Part/App/TopoShapeSolidPyImp.cpp | 2 +- src/Mod/Part/App/TopoShapeWirePyImp.cpp | 2 +- src/Mod/Part/App/ToroidPyImp.cpp | 6 ++--- src/Mod/Part/App/modelRefine.cpp | 2 +- src/Mod/Part/Gui/DlgExtrusion.cpp | 6 ++--- src/Mod/Part/Gui/DlgFilletEdges.cpp | 2 +- src/Mod/PartDesign/App/FeaturePipe.cpp | 2 +- src/Mod/PartDesign/App/FeaturePrimitive.cpp | 2 +- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 6 ++--- src/Mod/PartDesign/App/FeatureTransformed.cpp | 2 +- src/Mod/PartDesign/Gui/ReferenceSelection.cpp | 2 +- src/Mod/Sketcher/App/Sketch.cpp | 4 +-- src/Mod/Sketcher/App/SketchAnalysis.cpp | 6 ++--- src/Mod/Sketcher/App/SketchObject.cpp | 2 +- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 4 +-- src/Mod/Spreadsheet/App/Sheet.cpp | 2 +- .../Surface/App/FeatureGeomFillSurface.cpp | 6 ++--- src/Mod/TechDraw/App/DrawProjectSplit.cpp | 2 +- src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp | 2 +- src/Mod/TechDraw/App/Geometry.cpp | 2 +- 53 files changed, 98 insertions(+), 98 deletions(-) diff --git a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp index 1a653effd0..05b0480936 100644 --- a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp +++ b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp @@ -291,7 +291,7 @@ namespace try { axes = gp_Ax2( p0, normal, v01 ); } - catch ( Standard_Failure ) { + catch ( Standard_Failure &) { return false; } for ( size_t i = 0; i < nbNodes; ++i ) diff --git a/src/3rdParty/salomesmesh/src/SMESH/SMESH_Algo.cpp b/src/3rdParty/salomesmesh/src/SMESH/SMESH_Algo.cpp index ece996d02c..72005b3936 100644 --- a/src/3rdParty/salomesmesh/src/SMESH/SMESH_Algo.cpp +++ b/src/3rdParty/salomesmesh/src/SMESH/SMESH_Algo.cpp @@ -522,7 +522,7 @@ GeomAbs_Shape SMESH_Algo::Continuity(TopoDS_Edge E1, OCC_CATCH_SIGNALS; return BRepLProp::Continuity(C1, C2, u1, u2, tol, angTol); } - catch (Standard_Failure) { + catch (Standard_Failure&) { } return GeomAbs_C0; } diff --git a/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp b/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp index 3b66ec663e..5a07308310 100644 --- a/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp +++ b/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp @@ -1371,7 +1371,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face, try { tgtCS = gp_Ax3( xyz[0], OZ, OX ); } - catch ( Standard_Failure ) { + catch ( Standard_Failure &) { return badDistance; } trsf.SetTransformation( tgtCS ); diff --git a/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp b/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp index 7c150dadfb..a742702ff0 100644 --- a/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp +++ b/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp @@ -11178,7 +11178,7 @@ double SMESH_MeshEditor::OrientedAngle(const gp_Pnt& p0, const gp_Pnt& p1, const try { return n2.AngleWithRef(n1, vref); } - catch ( Standard_Failure ) { + catch ( Standard_Failure &) { } return Max( v1.Magnitude(), v2.Magnitude() ); } diff --git a/src/3rdParty/salomesmesh/src/SMESH/SMESH_MesherHelper.cpp b/src/3rdParty/salomesmesh/src/SMESH/SMESH_MesherHelper.cpp index c2c4e34358..36f79aa5ea 100644 --- a/src/3rdParty/salomesmesh/src/SMESH/SMESH_MesherHelper.cpp +++ b/src/3rdParty/salomesmesh/src/SMESH/SMESH_MesherHelper.cpp @@ -4445,7 +4445,7 @@ namespace { // Structures used by FixQuadraticElements() if ( curvNorm * D2 > 0 ) continue; // convex edge } - catch ( Standard_Failure ) + catch ( Standard_Failure &) { continue; } @@ -4558,7 +4558,7 @@ namespace { // Structures used by FixQuadraticElements() if ( concaveU || concaveV ) concaveFaces.push_back( face ); } - catch ( Standard_Failure ) + catch ( Standard_Failure &) { concaveFaces.push_back( face ); } @@ -5081,7 +5081,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError, try { gp_Vec x = x01.Normalized() + x12.Normalized(); trsf.SetTransformation( gp_Ax3( gp::Origin(), link1->Normal(), x), gp_Ax3() ); - } catch ( Standard_Failure ) { + } catch ( Standard_Failure &) { trsf.Invert(); } move.Transform(trsf); diff --git a/src/3rdParty/salomesmesh/src/SMESHDS/SMESHDS_Mesh.cpp b/src/3rdParty/salomesmesh/src/SMESHDS/SMESHDS_Mesh.cpp index 79713c80c2..70a3956d74 100644 --- a/src/3rdParty/salomesmesh/src/SMESHDS/SMESHDS_Mesh.cpp +++ b/src/3rdParty/salomesmesh/src/SMESHDS/SMESHDS_Mesh.cpp @@ -1377,7 +1377,7 @@ const TopoDS_Shape& SMESHDS_Mesh::IndexToShape(int ShapeIndex) const if ( ShapeIndex > 0 ) return myIndexToShape.FindKey(ShapeIndex); } - catch ( Standard_OutOfRange ) + catch ( Standard_OutOfRange &) { } static TopoDS_Shape nullShape; diff --git a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp index 7c9dca548a..ee50e352c9 100644 --- a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp +++ b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp @@ -1466,7 +1466,7 @@ bool _QuadFaceGrid::GetNormal( const TopoDS_Vertex& v, gp_Vec& n ) const n = d1u.Crossed( d1v ); return true; } - catch (Standard_Failure) { + catch (Standard_Failure&) { return false; } } diff --git a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Distribution.cpp b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Distribution.cpp index 16f2e5be4e..8bb1a7c60e 100644 --- a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Distribution.cpp +++ b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Distribution.cpp @@ -64,7 +64,7 @@ bool Function::value( const double, double& f ) const OCC_CATCH_SIGNALS; #endif f = pow( 10., f ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { f = 0.0; ok = false; } @@ -196,7 +196,7 @@ FunctionExpr::FunctionExpr( const char* str, const int conv ) #endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString )str ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { ok = false; } @@ -230,7 +230,7 @@ bool FunctionExpr::value( const double t, double& f ) const OCC_CATCH_SIGNALS; #endif f = myExpr->Expression()->Evaluate( myVars, myValues ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { f = 0.0; ok = false; } @@ -250,7 +250,7 @@ double FunctionExpr::integral( const double a, const double b ) const ( *static_cast( const_cast (this) ), a, b, 20 ); if( _int.IsDone() ) res = _int.Value(); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { res = 0.0; MESSAGE( "Exception in integral calculating" ); } diff --git a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_NumberOfSegments.cpp b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_NumberOfSegments.cpp index 05c5fc8ecd..47af4d7623 100644 --- a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_NumberOfSegments.cpp +++ b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_NumberOfSegments.cpp @@ -232,7 +232,7 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector& table) OCC_CATCH_SIGNALS; #endif val = pow( 10.0, val ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { throw SALOME_Exception( LOCALIZED( "invalid value")); return; } @@ -327,7 +327,7 @@ bool process( const TCollection_AsciiString& str, int convMode, #endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( str.ToCString() ); - } catch(Standard_Failure) { + } catch(Standard_Failure&) { parsed_ok = false; } diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 4f51f3f00f..587047c456 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -958,7 +958,7 @@ void PropertyLinkSubList::setPyObject(PyObject *value) dummy.setPyObject(value); this->setValue(dummy.getValue(), dummy.getSubValues()); } - catch (Base::TypeError) { + catch (Base::TypeError&) { if (PyTuple_Check(value) || PyList_Check(value)) { Py::Sequence list(value); Py::Sequence::size_type size = list.size(); diff --git a/src/Mod/Drawing/App/DrawingExport.cpp b/src/Mod/Drawing/App/DrawingExport.cpp index 831f38d5f0..0c3c23231d 100644 --- a/src/Mod/Drawing/App/DrawingExport.cpp +++ b/src/Mod/Drawing/App/DrawingExport.cpp @@ -107,7 +107,7 @@ TopoDS_Edge DrawingOutput::asCircle(const BRepAdaptor_Curve& c) const center.ChangeCoord().Divide(3); curv /= 3; } - catch (Standard_Failure) { + catch (Standard_Failure&) { // if getting center of curvature fails, e.g. // for straight lines it raises LProp_NotDefined return TopoDS_Edge(); @@ -350,7 +350,7 @@ void SVGOutput::printBezier(const BRepAdaptor_Curve& c, int id, std::ostream& ou str << "\" />"; out << str.str(); } - catch (Standard_Failure) { + catch (Standard_Failure&) { printGeneric(c, id, out); } } @@ -417,7 +417,7 @@ void SVGOutput::printBSpline(const BRepAdaptor_Curve& c, int id, std::ostream& o str << "\" />"; out << str.str(); } - catch (Standard_Failure) { + catch (Standard_Failure&) { printGeneric(c, id, out); } } @@ -723,7 +723,7 @@ void DXFOutput::printBSpline(const BRepAdaptor_Curve& c, int id, std::ostream& o //str << "\" />"; out << str.str(); } - catch (Standard_Failure) { + catch (Standard_Failure&) { printGeneric(c, id, out); } } diff --git a/src/Mod/Drawing/App/FeatureViewSpreadsheet.cpp b/src/Mod/Drawing/App/FeatureViewSpreadsheet.cpp index 70d5a80217..9e7e153d13 100644 --- a/src/Mod/Drawing/App/FeatureViewSpreadsheet.cpp +++ b/src/Mod/Drawing/App/FeatureViewSpreadsheet.cpp @@ -131,7 +131,7 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void) } } } - } catch (std::exception) { + } catch (std::exception&) { return new App::DocumentObjectExecReturn("Invalid cell range"); } diff --git a/src/Mod/Drawing/Gui/TaskOrthoViews.cpp b/src/Mod/Drawing/Gui/TaskOrthoViews.cpp index 0ef9d47e63..a921361871 100644 --- a/src/Mod/Drawing/Gui/TaskOrthoViews.cpp +++ b/src/Mod/Drawing/Gui/TaskOrthoViews.cpp @@ -107,7 +107,7 @@ void pagesize(string & page_template, int dims[4], int block[4]) break; } } - catch (Standard_Failure) + catch (Standard_Failure&) { } diff --git a/src/Mod/Fem/App/FemConstraint.cpp b/src/Mod/Fem/App/FemConstraint.cpp index 15d47db1ab..db9c689aa3 100644 --- a/src/Mod/Fem/App/FemConstraint.cpp +++ b/src/Mod/Fem/App/FemConstraint.cpp @@ -433,7 +433,7 @@ const Base::Vector3d Constraint::getDirection(const App::PropertyLinkSub &direct try { sh = shape.getSubShape(subName.c_str()); } - catch (Standard_Failure) { + catch (Standard_Failure&) { std::stringstream str; str << "No such sub-element '" << subName << "'"; throw Base::AttributeError(str.str()); diff --git a/src/Mod/Fem/App/FemTools.cpp b/src/Mod/Fem/App/FemTools.cpp index 4aad1ab6dc..06d1d15470 100644 --- a/src/Mod/Fem/App/FemTools.cpp +++ b/src/Mod/Fem/App/FemTools.cpp @@ -99,7 +99,7 @@ bool Fem::Tools::isPlanar(const TopoDS_Face& face) return true; } - catch (Standard_Failure) { + catch (Standard_Failure&) { return false; } } @@ -131,7 +131,7 @@ bool Fem::Tools::isPlanar(const TopoDS_Face& face) return true; } - catch (Standard_Failure) { + catch (Standard_Failure&) { return false; } } @@ -163,7 +163,7 @@ gp_XYZ Fem::Tools::getDirection(const TopoDS_Face& face) gp_Pln plane(p1, gp_Dir(vec3)); dir = plane.Axis().Direction().XYZ(); } - catch (Standard_Failure) { + catch (Standard_Failure&) { } } else if (surface.GetType() == GeomAbs_BezierSurface) { @@ -182,7 +182,7 @@ gp_XYZ Fem::Tools::getDirection(const TopoDS_Face& face) gp_Pln plane(p1, gp_Dir(vec3)); dir = plane.Axis().Direction().XYZ(); } - catch (Standard_Failure) { + catch (Standard_Failure&) { } } @@ -213,7 +213,7 @@ bool Fem::Tools::isLinear(const TopoDS_Edge& edge) return true; } - catch (Standard_Failure) { + catch (Standard_Failure&) { return false; } } @@ -235,7 +235,7 @@ bool Fem::Tools::isLinear(const TopoDS_Edge& edge) return true; } - catch (Standard_Failure) { + catch (Standard_Failure&) { return false; } } @@ -260,7 +260,7 @@ gp_XYZ Fem::Tools::getDirection(const TopoDS_Edge& edge) gp_Lin line(s1, gp_Dir(vec)); dir = line.Direction().XYZ(); } - catch (Standard_Failure) { + catch (Standard_Failure&) { } } else if (curve.GetType() == GeomAbs_BezierCurve) { @@ -272,7 +272,7 @@ gp_XYZ Fem::Tools::getDirection(const TopoDS_Edge& edge) gp_Lin line(s1, gp_Dir(vec)); dir = line.Direction().XYZ(); } - catch (Standard_Failure) { + catch (Standard_Failure&) { } } diff --git a/src/Mod/Part/App/AppPartPy.cpp b/src/Mod/Part/App/AppPartPy.cpp index 7639423c7f..624020faec 100644 --- a/src/Mod/Part/App/AppPartPy.cpp +++ b/src/Mod/Part/App/AppPartPy.cpp @@ -845,7 +845,7 @@ private: return Py::None(); //prevents compiler warning } } - catch (Standard_Failure err) { + catch (Standard_Failure& err) { std::stringstream errmsg; errmsg << "Creation of solid failed: " << err.GetMessageString(); throw Py::Exception(PartExceptionOCCError, errmsg.str().c_str()); @@ -897,10 +897,10 @@ private: ); return Py::asObject(new TopoShapeFacePy(new TopoShape((Face.Face())))); } - catch (Standard_DomainError) { + catch (Standard_DomainError&) { throw Py::Exception(PartExceptionOCCDomainError, "creation of plane failed"); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::Exception(PartExceptionOCCError, "creation of plane failed"); } } @@ -939,7 +939,7 @@ private: TopoDS_Shape ResultShape = mkBox.Shape(); return Py::asObject(new TopoShapeSolidPy(new TopoShape(ResultShape))); } - catch (Standard_DomainError) { + catch (Standard_DomainError&) { throw Py::Exception(PartExceptionOCCDomainError, "creation of box failed"); } } @@ -989,7 +989,7 @@ private: mkSolid.Add(mkWedge.Shell()); return Py::asObject(new TopoShapeSolidPy(new TopoShape(mkSolid.Solid()))); } - catch (Standard_DomainError) { + catch (Standard_DomainError&) { throw Py::Exception(PartExceptionOCCDomainError, "creation of wedge failed"); } } @@ -1124,7 +1124,7 @@ private: TopoDS_Edge edge = aMakeEdge.Edge(); return Py::asObject(new TopoShapeEdgePy(new TopoShape(edge))); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::Exception(PartExceptionOCCError, "creation of circle failed"); } } @@ -1154,7 +1154,7 @@ private: TopoDS_Shape shape = mkSphere.Shape(); return Py::asObject(new TopoShapeSolidPy(new TopoShape(shape))); } - catch (Standard_DomainError) { + catch (Standard_DomainError&) { throw Py::Exception(PartExceptionOCCDomainError, "creation of sphere failed"); } } @@ -1184,7 +1184,7 @@ private: TopoDS_Shape shape = mkCyl.Shape(); return Py::asObject(new TopoShapeSolidPy(new TopoShape(shape))); } - catch (Standard_DomainError) { + catch (Standard_DomainError&) { throw Py::Exception(PartExceptionOCCDomainError, "creation of cylinder failed"); } } @@ -1214,7 +1214,7 @@ private: TopoDS_Shape shape = mkCone.Shape(); return Py::asObject(new TopoShapeSolidPy(new TopoShape(shape))); } - catch (Standard_DomainError) { + catch (Standard_DomainError&) { throw Py::Exception(PartExceptionOCCDomainError, "creation of cone failed"); } } @@ -1244,7 +1244,7 @@ private: const TopoDS_Shape& shape = mkTorus.Shape(); return Py::asObject(new TopoShapeSolidPy(new TopoShape(shape))); } - catch (Standard_DomainError) { + catch (Standard_DomainError&) { throw Py::Exception(PartExceptionOCCDomainError, "creation of torus failed"); } } @@ -1396,7 +1396,7 @@ private: return Py::asObject(new TopoShapePy(new TopoShape(shape))); } } - catch (Standard_DomainError) { + catch (Standard_DomainError&) { throw Py::Exception(PartExceptionOCCDomainError, "creation of revolved shape failed"); } } @@ -1424,7 +1424,7 @@ private: throw Py::Exception(PartExceptionOCCError, "curves must either be edges or wires"); } } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::Exception(PartExceptionOCCError, "creation of ruled surface failed"); } } @@ -1712,7 +1712,7 @@ private: CharList = FT2FC(unichars,pysize,dir,fontfile,height,track); } } - catch (Standard_DomainError) { // Standard_DomainError is OCC error. + catch (Standard_DomainError&) { // Standard_DomainError is OCC error. throw Py::Exception(PartExceptionOCCDomainError, "makeWireString failed - Standard_DomainError"); } catch (std::runtime_error& e) { // FT2 or FT2FC errors diff --git a/src/Mod/Part/App/ArcOfConicPyImp.cpp b/src/Mod/Part/App/ArcOfConicPyImp.cpp index 1790d13193..95ead9445a 100644 --- a/src/Mod/Part/App/ArcOfConicPyImp.cpp +++ b/src/Mod/Part/App/ArcOfConicPyImp.cpp @@ -147,7 +147,7 @@ void ArcOfConicPy::setAxis(Py::Object arg) axis.SetDirection(gp_Dir(val.x, val.y, val.z)); conic->SetAxis(axis); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set axis"); } } @@ -187,7 +187,7 @@ void ArcOfConicPy::setXAxis(Py::Object arg) pos.SetXDirection(gp_Dir(val.x, val.y, val.z)); conic->SetPosition(pos); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set X axis"); } } @@ -227,7 +227,7 @@ void ArcOfConicPy::setYAxis(Py::Object arg) pos.SetYDirection(gp_Dir(val.x, val.y, val.z)); conic->SetPosition(pos); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set Y axis"); } } diff --git a/src/Mod/Part/App/AttachEnginePyImp.cpp b/src/Mod/Part/App/AttachEnginePyImp.cpp index b93571acca..ba84e2181c 100644 --- a/src/Mod/Part/App/AttachEnginePyImp.cpp +++ b/src/Mod/Part/App/AttachEnginePyImp.cpp @@ -408,7 +408,7 @@ PyObject* AttachEnginePy::calculateAttachedPlacement(PyObject* args) Base::Placement result; try{ result = this->getAttachEnginePtr()->calculateAttachedPlacement(plm); - } catch (ExceptionCancel) { + } catch (ExceptionCancel&) { Py_IncRef(Py_None); return Py_None; } diff --git a/src/Mod/Part/App/AttachExtension.cpp b/src/Mod/Part/App/AttachExtension.cpp index 8ca7a5fad5..dfe18cfecc 100644 --- a/src/Mod/Part/App/AttachExtension.cpp +++ b/src/Mod/Part/App/AttachExtension.cpp @@ -129,7 +129,7 @@ bool AttachExtension::positionBySupport() return false; getPlacement().setValue(_attacher->calculateAttachedPlacement(getPlacement().getValue())); return true; - } catch (ExceptionCancel) { + } catch (ExceptionCancel&) { //disabled, don't do anything return false; }; diff --git a/src/Mod/Part/App/AttachExtensionPyImp.cpp b/src/Mod/Part/App/AttachExtensionPyImp.cpp index e4e25d92bb..57448a418d 100644 --- a/src/Mod/Part/App/AttachExtensionPyImp.cpp +++ b/src/Mod/Part/App/AttachExtensionPyImp.cpp @@ -57,7 +57,7 @@ Py::Object AttachExtensionPy::getAttacher(void) const { try { this->getAttachExtensionPtr()->attacher(); //throws if attacher is not set - } catch (Base::Exception) { + } catch (Base::Exception&) { return Py::None(); } diff --git a/src/Mod/Part/App/Attacher.cpp b/src/Mod/Part/App/Attacher.cpp index 13fedfc579..39613f56f3 100644 --- a/src/Mod/Part/App/Attacher.cpp +++ b/src/Mod/Part/App/Attacher.cpp @@ -783,7 +783,7 @@ void AttachEngine::readLinks(const App::PropertyLinkSubList &references, if (sub[i].length()>0){ try{ storage.push_back(shape->getSubShape(sub[i].c_str())); - } catch (Standard_Failure){ + } catch (Standard_Failure&){ throw Base::Exception("AttachEngine3D: subshape not found"); } if(storage[storage.size()-1].IsNull()) diff --git a/src/Mod/Part/App/ConePyImp.cpp b/src/Mod/Part/App/ConePyImp.cpp index 0316211e7d..bed52fa0e1 100644 --- a/src/Mod/Part/App/ConePyImp.cpp +++ b/src/Mod/Part/App/ConePyImp.cpp @@ -295,7 +295,7 @@ void ConePy::setAxis(Py::Object arg) axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); this_surf->SetAxis(axis); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set axis"); } } diff --git a/src/Mod/Part/App/ConicPyImp.cpp b/src/Mod/Part/App/ConicPyImp.cpp index 94a2fea337..b2ec77485d 100644 --- a/src/Mod/Part/App/ConicPyImp.cpp +++ b/src/Mod/Part/App/ConicPyImp.cpp @@ -150,7 +150,7 @@ void ConicPy::setAxis(Py::Object arg) axis.SetDirection(gp_Dir(val.x, val.y, val.z)); conic->SetAxis(axis); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set axis"); } } @@ -186,7 +186,7 @@ void ConicPy::setXAxis(Py::Object arg) pos.SetXDirection(gp_Dir(val.x, val.y, val.z)); conic->SetPosition(pos); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set X axis"); } } @@ -222,7 +222,7 @@ void ConicPy::setYAxis(Py::Object arg) pos.SetYDirection(gp_Dir(val.x, val.y, val.z)); conic->SetPosition(pos); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set Y axis"); } } diff --git a/src/Mod/Part/App/CylinderPyImp.cpp b/src/Mod/Part/App/CylinderPyImp.cpp index 3b2f412db9..271a050afb 100644 --- a/src/Mod/Part/App/CylinderPyImp.cpp +++ b/src/Mod/Part/App/CylinderPyImp.cpp @@ -292,7 +292,7 @@ void CylinderPy::setAxis(Py::Object arg) axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); this_surf->SetAxis(axis); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set axis"); } } diff --git a/src/Mod/Part/App/FeaturePartBoolean.cpp b/src/Mod/Part/App/FeaturePartBoolean.cpp index e04bfac8b2..4b567c17d4 100644 --- a/src/Mod/Part/App/FeaturePartBoolean.cpp +++ b/src/Mod/Part/App/FeaturePartBoolean.cpp @@ -118,7 +118,7 @@ App::DocumentObjectExecReturn *Boolean::execute(void) history[0] = joinHistory(history[0], hist); history[1] = joinHistory(history[1], hist); } - catch (Standard_Failure) { + catch (Standard_Failure&) { // do nothing } } diff --git a/src/Mod/Part/App/FeaturePartCommon.cpp b/src/Mod/Part/App/FeaturePartCommon.cpp index ad7df72161..83f47fabc4 100644 --- a/src/Mod/Part/App/FeaturePartCommon.cpp +++ b/src/Mod/Part/App/FeaturePartCommon.cpp @@ -161,7 +161,7 @@ App::DocumentObjectExecReturn *MultiCommon::execute(void) for (std::vector::iterator jt = history.begin(); jt != history.end(); ++jt) *jt = joinHistory(*jt, hist); } - catch (Standard_Failure) { + catch (Standard_Failure&) { // do nothing } } diff --git a/src/Mod/Part/App/FeaturePartFuse.cpp b/src/Mod/Part/App/FeaturePartFuse.cpp index e22b5f5265..fcc8d59bfc 100644 --- a/src/Mod/Part/App/FeaturePartFuse.cpp +++ b/src/Mod/Part/App/FeaturePartFuse.cpp @@ -186,7 +186,7 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void) for (std::vector::iterator jt = history.begin(); jt != history.end(); ++jt) *jt = joinHistory(*jt, hist); } - catch (Standard_Failure) { + catch (Standard_Failure&) { // do nothing } } diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 368dfe338e..ac4a9560ba 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -454,7 +454,7 @@ bool GeomCurve::closestParameter(const Base::Vector3d& point, double &u) const return true; } } - catch (StdFail_NotDone e) { // projection does not exist on trimmer curve, let's try basis curve + catch (StdFail_NotDone& e) { // projection does not exist on trimmer curve, let's try basis curve closestParameterToBasicCurve(point,u); if(abs(u-c->FirstParameter()) < abs(u-c->LastParameter())) diff --git a/src/Mod/Part/App/PlanePyImp.cpp b/src/Mod/Part/App/PlanePyImp.cpp index aa2ac03164..855d48bff8 100644 --- a/src/Mod/Part/App/PlanePyImp.cpp +++ b/src/Mod/Part/App/PlanePyImp.cpp @@ -250,7 +250,7 @@ void PlanePy::setAxis(Py::Object arg) axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); this_surf->SetAxis(axis); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set axis"); } } diff --git a/src/Mod/Part/App/PropertyTopoShape.cpp b/src/Mod/Part/App/PropertyTopoShape.cpp index eb8d1f2bae..258720a3ae 100644 --- a/src/Mod/Part/App/PropertyTopoShape.cpp +++ b/src/Mod/Part/App/PropertyTopoShape.cpp @@ -130,7 +130,7 @@ Base::BoundBox3d PropertyPartShape::getBoundingBox() const box.MinZ = zMin; box.MaxZ = zMax; } - catch (Standard_Failure) { + catch (Standard_Failure&) { } return box; diff --git a/src/Mod/Part/App/SpherePyImp.cpp b/src/Mod/Part/App/SpherePyImp.cpp index 7220da3cf4..34d6e580ef 100644 --- a/src/Mod/Part/App/SpherePyImp.cpp +++ b/src/Mod/Part/App/SpherePyImp.cpp @@ -176,7 +176,7 @@ void SpherePy::setAxis(Py::Object arg) axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); this_surf->SetAxis(axis); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set axis"); } } diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 495e047088..ddaf088d6c 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -647,7 +647,7 @@ void TopoShape::importBinary(std::istream& str) this->_Shape.Location(theShapeSet.Locations().Location (locId)); this->_Shape.Orientation (anOrient); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Base::RuntimeError("Failed to read shape from binary stream"); } } @@ -960,7 +960,7 @@ Base::BoundBox3d TopoShape::getBoundBox(void) const box.MinZ = zMin; box.MaxZ = zMax; } - catch (Standard_Failure) { + catch (Standard_Failure&) { } return box; diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index 720c9b695a..118b7862ee 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -1892,7 +1892,7 @@ PyObject* TopoShapePy::project(PyObject *args) algo.Build(); return new TopoShapePy(new TopoShape(algo.Projection())); } - catch (Standard_Failure) { + catch (Standard_Failure&) { PyErr_SetString(PartExceptionOCCError, "Failed to project shape"); return NULL; } diff --git a/src/Mod/Part/App/TopoShapeSolidPyImp.cpp b/src/Mod/Part/App/TopoShapeSolidPyImp.cpp index 42d00916e2..0d6f112d7d 100644 --- a/src/Mod/Part/App/TopoShapeSolidPyImp.cpp +++ b/src/Mod/Part/App/TopoShapeSolidPyImp.cpp @@ -119,7 +119,7 @@ int TopoShapeSolidPy::PyInit(PyObject* args, PyObject* /*kwd*/) } } - catch (Standard_Failure err) { + catch (Standard_Failure& err) { std::stringstream errmsg; errmsg << "Creation of solid failed: " << err.GetMessageString(); PyErr_SetString(PartExceptionOCCError, errmsg.str().c_str()); diff --git a/src/Mod/Part/App/TopoShapeWirePyImp.cpp b/src/Mod/Part/App/TopoShapeWirePyImp.cpp index 8c0bdbc0bc..79f98d9aac 100644 --- a/src/Mod/Part/App/TopoShapeWirePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeWirePyImp.cpp @@ -348,7 +348,7 @@ PyObject* TopoShapeWirePy::approximate(PyObject *args) return 0; } } - catch (Standard_Failure) { + catch (Standard_Failure&) { PyErr_SetString(PartExceptionOCCError, "failed to approximate wire"); return 0; } diff --git a/src/Mod/Part/App/ToroidPyImp.cpp b/src/Mod/Part/App/ToroidPyImp.cpp index 18bbcec911..d1897d123d 100644 --- a/src/Mod/Part/App/ToroidPyImp.cpp +++ b/src/Mod/Part/App/ToroidPyImp.cpp @@ -118,7 +118,7 @@ void ToroidPy::setMajorRadius(Py::Float arg) (getGeomToroidPtr()->handle()); torus->SetMajorRadius((double)arg); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("Major radius must be positive and higher than minor radius"); } } @@ -137,7 +137,7 @@ void ToroidPy::setMinorRadius(Py::Float arg) (getGeomToroidPtr()->handle()); torus->SetMinorRadius((double)arg); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("Minor radius must be positive and lower than major radius"); } } @@ -204,7 +204,7 @@ void ToroidPy::setAxis(Py::Object arg) axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); this_surf->SetAxis(axis); } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Py::RuntimeError("cannot set axis"); } } diff --git a/src/Mod/Part/App/modelRefine.cpp b/src/Mod/Part/App/modelRefine.cpp index da82cb0888..14de25b540 100644 --- a/src/Mod/Part/App/modelRefine.cpp +++ b/src/Mod/Part/App/modelRefine.cpp @@ -1064,7 +1064,7 @@ bool FaceUniter::process() sew.Perform(); try { workShell = TopoDS::Shell(sew.SewedShape()); - } catch (Standard_Failure) { + } catch (Standard_Failure&) { return false; } // update the list of modifications diff --git a/src/Mod/Part/Gui/DlgExtrusion.cpp b/src/Mod/Part/Gui/DlgExtrusion.cpp index b2df44717b..41985e5133 100644 --- a/src/Mod/Part/Gui/DlgExtrusion.cpp +++ b/src/Mod/Part/Gui/DlgExtrusion.cpp @@ -393,7 +393,7 @@ void DlgExtrusion::accept() try{ apply(); QDialog::accept(); - } catch (Base::AbortException){ + } catch (Base::AbortException&){ }; } @@ -454,7 +454,7 @@ void DlgExtrusion::apply() activeDoc->commitTransaction(); Gui::Command::updateActive(); } - catch (Base::AbortException){ + catch (Base::AbortException&){ throw; } catch (Base::Exception &err){ @@ -744,7 +744,7 @@ void TaskExtrusion::clicked(int id) if (id == QDialogButtonBox::Apply) { try{ widget->apply(); - } catch (Base::AbortException){ + } catch (Base::AbortException&){ }; } diff --git a/src/Mod/Part/Gui/DlgFilletEdges.cpp b/src/Mod/Part/Gui/DlgFilletEdges.cpp index 920f211749..07548a8595 100644 --- a/src/Mod/Part/Gui/DlgFilletEdges.cpp +++ b/src/Mod/Part/Gui/DlgFilletEdges.cpp @@ -453,7 +453,7 @@ void DlgFilletEdges::onSelectEdgesOfFace(const QString& subelement, int type) } } } - catch (Standard_Failure) { + catch (Standard_Failure&) { } } } diff --git a/src/Mod/PartDesign/App/FeaturePipe.cpp b/src/Mod/PartDesign/App/FeaturePipe.cpp index d0cc4a0143..8c07302849 100644 --- a/src/Mod/PartDesign/App/FeaturePipe.cpp +++ b/src/Mod/PartDesign/App/FeaturePipe.cpp @@ -492,7 +492,7 @@ void Pipe::buildPipePath(const Part::TopoShape& shape, const std::vector< std::s throw Base::Exception("Spine is neither an edge nor a wire."); } } - catch (Standard_Failure) { + catch (Standard_Failure&) { throw Base::Exception("Invalid spine."); } } diff --git a/src/Mod/PartDesign/App/FeaturePrimitive.cpp b/src/Mod/PartDesign/App/FeaturePrimitive.cpp index 92f322d432..e924fb9d51 100644 --- a/src/Mod/PartDesign/App/FeaturePrimitive.cpp +++ b/src/Mod/PartDesign/App/FeaturePrimitive.cpp @@ -80,7 +80,7 @@ TopoDS_Shape FeaturePrimitive::refineShapeIfActive(const TopoDS_Shape& oldShape) TopoDS_Shape resShape = mkRefine.Shape(); return resShape; } - catch (Standard_Failure) { + catch (Standard_Failure&) { return oldShape; } } diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 2a8873efe2..bdfc7d9e85 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -757,7 +757,7 @@ void ProfileBased::remapSupportShape(const TopoDS_Shape& newShape) try { element = shape.getSubShape(it->c_str()); } - catch (Standard_Failure) { + catch (Standard_Failure&) { // This shape doesn't even exist, so no chance to do some tests newSubValues.push_back(*it); continue; @@ -770,7 +770,7 @@ void ProfileBased::remapSupportShape(const TopoDS_Shape& newShape) success = true; } } - catch (Standard_Failure) { + catch (Standard_Failure&) { } // try an exact matching if (!success) { @@ -1051,7 +1051,7 @@ TopoDS_Shape ProfileBased::refineShapeIfActive(const TopoDS_Shape& oldShape) con TopoDS_Shape resShape = mkRefine.Shape(); return resShape; } - catch (Standard_Failure) { + catch (Standard_Failure&) { return oldShape; } } diff --git a/src/Mod/PartDesign/App/FeatureTransformed.cpp b/src/Mod/PartDesign/App/FeatureTransformed.cpp index ca75b5d6db..1bbb18a1ea 100644 --- a/src/Mod/PartDesign/App/FeatureTransformed.cpp +++ b/src/Mod/PartDesign/App/FeatureTransformed.cpp @@ -401,7 +401,7 @@ TopoDS_Shape Transformed::refineShapeIfActive(const TopoDS_Shape& oldShape) cons TopoDS_Shape resShape = mkRefine.Shape(); return resShape; } - catch (Standard_Failure) { + catch (Standard_Failure&) { return oldShape; } } diff --git a/src/Mod/PartDesign/Gui/ReferenceSelection.cpp b/src/Mod/PartDesign/Gui/ReferenceSelection.cpp index 1ec8d1431e..62e572b930 100644 --- a/src/Mod/PartDesign/Gui/ReferenceSelection.cpp +++ b/src/Mod/PartDesign/Gui/ReferenceSelection.cpp @@ -105,7 +105,7 @@ bool ReferenceSelection::allow(App::Document* pDoc, App::DocumentObject* pObj, c return true; } } - } catch (const Base::Exception) + } catch (const Base::Exception&) { } } return false; // The Plane/Axis doesn't fits our needs diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 865c92eaa5..36e069dcdf 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -3048,7 +3048,7 @@ bool Sketch::updateGeometry() #endif } - } catch (Base::Exception e) { + } catch (Base::Exception &e) { Base::Console().Error("Updating geometry: Error build geometry(%d): %s\n", i,e.what()); return false; @@ -3659,7 +3659,7 @@ bool Sketch::hasDependentParameters(int geoId, PointPos pos) const try { geoId = checkGeoId(geoId); } - catch (Base::Exception) { + catch (Base::Exception&) { return false; } diff --git a/src/Mod/Sketcher/App/SketchAnalysis.cpp b/src/Mod/Sketcher/App/SketchAnalysis.cpp index 5beff47359..8e922a1225 100644 --- a/src/Mod/Sketcher/App/SketchAnalysis.cpp +++ b/src/Mod/Sketcher/App/SketchAnalysis.cpp @@ -337,7 +337,7 @@ void SketchAnalysis::analyseMissingPointOnPointCoincident(double angleprecision) } } - catch(Base::Exception e) { + catch(Base::Exception &e) { Base::Console().Warning("Point-On-Point Coincidence analysis: unable to obtain derivative. Detection ignored.\n"); continue; } @@ -782,7 +782,7 @@ int SketchAnalysis::autoconstraint(double precision, double angleprecision, bool try { makeMissingEquality(); } - catch(Base::RuntimeError e) + catch(Base::RuntimeError &e) { doc->abortTransaction(); throw; @@ -805,4 +805,4 @@ int SketchAnalysis::autoconstraint(double precision, double angleprecision, bool return 0; -} \ No newline at end of file +} diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 8c564d240c..dbb4cc7ab9 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -4931,7 +4931,7 @@ void SketchObject::validateExternalLinks(void) refSubShape = refShape.getSubShape(SubElement.c_str()); } } - catch (Standard_Failure) { + catch (Standard_Failure&) { rebuild = true ; Objects.erase(Objects.begin()+i); SubElements.erase(SubElements.begin()+i); diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 4235cd2897..db8c60a614 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -3924,7 +3924,7 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer try { spline->normalAt(paramlist[i],normallist[i]); } - catch(Base::Exception) { + catch(Base::Exception&) { normallist[i] = Base::Vector3d(0,0,0); } @@ -5126,7 +5126,7 @@ Restart: break; } - } catch (Base::Exception e) { + } catch (Base::Exception &e) { Base::Console().Error("Exception during draw: %s\n", e.what()); } catch (...){ Base::Console().Error("Exception during draw: unknown\n"); diff --git a/src/Mod/Spreadsheet/App/Sheet.cpp b/src/Mod/Spreadsheet/App/Sheet.cpp index cabc91b542..5b7b986b0f 100644 --- a/src/Mod/Spreadsheet/App/Sheet.cpp +++ b/src/Mod/Spreadsheet/App/Sheet.cpp @@ -793,7 +793,7 @@ DocumentObjectExecReturn *Sheet::execute(void) ++i; } } - catch (std::exception) { + catch (std::exception&) { // Cycle detected; flag all with errors std::map::const_iterator i = VertexList.begin(); diff --git a/src/Mod/Surface/App/FeatureGeomFillSurface.cpp b/src/Mod/Surface/App/FeatureGeomFillSurface.cpp index a3cde6a462..eaec72c2a0 100644 --- a/src/Mod/Surface/App/FeatureGeomFillSurface.cpp +++ b/src/Mod/Surface/App/FeatureGeomFillSurface.cpp @@ -116,7 +116,7 @@ void ShapeValidator::checkAndAdd(const Part::TopoShape &ts, const char *subName, checkAndAdd(ts.getShape(), aWD); } } - catch (Standard_Failure) { // any OCC exception means an unappropriate shape in the selection + catch (Standard_Failure&) { // any OCC exception means an unappropriate shape in the selection Standard_Failure::Raise("Wrong shape type.\n"); } } @@ -160,11 +160,11 @@ App::DocumentObjectExecReturn *GeomFillSurface::execute(void) return App::DocumentObject::StdReturn; } - catch (Standard_ConstructionError) { + catch (Standard_ConstructionError&) { // message is in a Latin language, show a normal one return new App::DocumentObjectExecReturn("Curves are disjoint."); } - catch (StdFail_NotDone) { + catch (StdFail_NotDone&) { return new App::DocumentObjectExecReturn("A curve was not a B-spline and could not be converted into one."); } catch (Standard_Failure& e) { diff --git a/src/Mod/TechDraw/App/DrawProjectSplit.cpp b/src/Mod/TechDraw/App/DrawProjectSplit.cpp index e04021e478..858fc1f969 100644 --- a/src/Mod/TechDraw/App/DrawProjectSplit.cpp +++ b/src/Mod/TechDraw/App/DrawProjectSplit.cpp @@ -368,7 +368,7 @@ std::vector DrawProjectSplit::split1Edge(TopoDS_Edge e, std::vector result.push_back(e1); } } - catch (Standard_Failure) { + catch (Standard_Failure&) { Base::Console().Message("LOG - DPS::split1Edge failed building edge segment\n"); } } diff --git a/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp b/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp index 336c008494..237e4e31cc 100644 --- a/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp +++ b/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp @@ -203,7 +203,7 @@ std::string DrawViewSpreadsheet::getSheetImage(void) break; } } - } catch (std::exception) { + } catch (std::exception&) { Base::Console().Error("Invalid cell range for %s\n",getNameInDocument()); return result.str(); } diff --git a/src/Mod/TechDraw/App/Geometry.cpp b/src/Mod/TechDraw/App/Geometry.cpp index 56f68ce846..343af36814 100644 --- a/src/Mod/TechDraw/App/Geometry.cpp +++ b/src/Mod/TechDraw/App/Geometry.cpp @@ -241,7 +241,7 @@ BaseGeom* BaseGeom::baseFactory(TopoDS_Edge edge) } break; } - catch (Standard_Failure) { + catch (Standard_Failure&) { if (bspline != nullptr) { delete bspline; bspline = nullptr;