Sketcher: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:13:52 +01:00
parent 7633a079b4
commit 51186c018e
44 changed files with 371 additions and 371 deletions

View File

@@ -103,9 +103,9 @@ PROPERTY_SOURCE(Sketcher::SketchObject, Part::Part2DObject)
SketchObject::SketchObject()
{
ADD_PROPERTY_TYPE(Geometry, (0) ,"Sketch",(App::PropertyType)(App::Prop_None),"Sketch geometry");
ADD_PROPERTY_TYPE(Constraints, (0) ,"Sketch",(App::PropertyType)(App::Prop_None),"Sketch constraints");
ADD_PROPERTY_TYPE(ExternalGeometry,(0,0),"Sketch",(App::PropertyType)(App::Prop_None),"Sketch external geometry");
ADD_PROPERTY_TYPE(Geometry, (nullptr) ,"Sketch",(App::PropertyType)(App::Prop_None),"Sketch geometry");
ADD_PROPERTY_TYPE(Constraints, (nullptr) ,"Sketch",(App::PropertyType)(App::Prop_None),"Sketch constraints");
ADD_PROPERTY_TYPE(ExternalGeometry,(nullptr,nullptr),"Sketch",(App::PropertyType)(App::Prop_None),"Sketch external geometry");
ADD_PROPERTY_TYPE(FullyConstrained, (false),"Sketch",(App::PropertyType)(App::Prop_Output|App::Prop_ReadOnly |App::Prop_Hidden),"Sketch is fully constrained");
Geometry.setOrderRelevant(true);
@@ -3326,7 +3326,7 @@ bool SketchObject::isExternalAllowed(App::Document *pDoc, App::DocumentObject *p
App::Part* part_this = App::Part::getPartOfObject(this);
App::Part* part_obj = App::Part::getPartOfObject(pObj);
if (part_this == part_obj){ //either in the same part, or in the root of document
if (body_this == NULL) {
if (body_this == nullptr) {
return true;
} else if (body_this == body_obj) {
return true;
@@ -3385,7 +3385,7 @@ bool SketchObject::isCarbonCopyAllowed(App::Document *pDoc, App::DocumentObject
App::Part* part_this = App::Part::getPartOfObject(this);
App::Part* part_obj = App::Part::getPartOfObject(pObj);
if (part_this == part_obj){ //either in the same part, or in the root of document
if (body_this != NULL) {
if (body_this != nullptr) {
if (body_this != body_obj) {
if (!this->allowOtherBody) {
if (rsn)
@@ -7681,7 +7681,7 @@ std::string SketchObject::validateExpression(const App::ObjectIdentifier &path,
{
const App::Property * prop = path.getProperty();
assert(expr != 0);
assert(expr != nullptr);
if (!prop)
return "Property not found";
@@ -7720,7 +7720,7 @@ double SketchObject::calculateAngleViaPoint(int GeoId1, int GeoId2, double px, d
const Part::Geometry *p1=this->getGeometry(GeoId1);
const Part::Geometry *p2=this->getGeometry(GeoId2);
if(p1!=0 && p2!=0) {
if(p1!=nullptr && p2!=nullptr) {
int i1 = sk.addGeometry(this->getGeometry(GeoId1));
int i2 = sk.addGeometry(this->getGeometry(GeoId2));
@@ -8208,7 +8208,7 @@ bool SketchObject::constraintHasExpression(int constrid) const
App::PropertyExpressionEngine::ExpressionInfo expr_info = this->getExpression(spath);
return (expr_info.expression != 0);
return (expr_info.expression != nullptr);
}
@@ -8229,7 +8229,7 @@ int SketchObject::port_reversedExternalArcs(bool justAnalyze)
for(std::size_t ic = 0; ic<newVals.size(); ic++){//ic = index of constraint
bool affected=false;
Constraint *constNew = 0;
Constraint *constNew = nullptr;
for(int ig=1; ig<=3; ig++){//cycle through constraint.first, second, third
int geoId = 0;
Sketcher::PointPos posId = PointPos::none;