From 2a88c7c7dfed699d2a4944bda13bf8626ed39315 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 5 Aug 2023 23:44:44 +0200 Subject: [PATCH] modernize C++: use bool literals --- src/App/DocumentPyImp.cpp | 2 +- src/App/Expression.cpp | 2 +- src/Gui/ExpressionCompleter.cpp | 2 +- src/Gui/Selection.cpp | 2 +- src/Gui/Tree.cpp | 2 +- src/Gui/View3DSettings.cpp | 2 +- src/Gui/ViewProviderLink.cpp | 6 +++--- src/Gui/WidgetFactory.cpp | 2 +- src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp | 4 ++-- src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp | 4 ++-- src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp | 8 ++++---- src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp | 2 +- src/Mod/Import/App/ExportOCAF.cpp | 4 ++-- src/Mod/Import/App/ImportOCAF2.cpp | 10 +++++----- src/Mod/MeshPart/App/MeshFlatteningLscmRelax.cpp | 2 +- src/Mod/Part/App/Geometry.cpp | 8 ++++---- src/Mod/PartDesign/App/FeatureExtrude.cpp | 2 +- src/Mod/PartDesign/App/FeatureHelix.cpp | 2 +- src/Mod/PartDesign/App/FeatureHole.cpp | 6 +++--- src/Mod/PartDesign/Gui/Utils.cpp | 2 +- src/Mod/Path/App/Area.cpp | 2 +- src/Mod/TechDraw/App/DrawViewPart.cpp | 6 +++--- src/Mod/TechDraw/Gui/QGIViewPart.cpp | 2 +- src/Mod/TechDraw/Gui/QGVPage.cpp | 4 ++-- src/Mod/TechDraw/Gui/TaskLineDecor.cpp | 4 ++-- 25 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/App/DocumentPyImp.cpp b/src/App/DocumentPyImp.cpp index 874b2a8c5a..2a06da2ef5 100644 --- a/src/App/DocumentPyImp.cpp +++ b/src/App/DocumentPyImp.cpp @@ -614,7 +614,7 @@ PyObject* DocumentPy::getObject(PyObject *args) PyErr_SetString(PyExc_TypeError, "a string or integer is required"); return nullptr; } - while (0); + while (false); if (obj) return obj->getPyObject(); diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index 639fb8dd21..13f7d73389 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -2806,7 +2806,7 @@ void VariableExpression::addComponent(Component *c) { var << ObjectIdentifier::RangeComponent(l1,l2,l3); return; } - }while(0); + }while(false); Expression::addComponent(c); } diff --git a/src/Gui/ExpressionCompleter.cpp b/src/Gui/ExpressionCompleter.cpp index 4b6beee2ad..6bd88839fb 100644 --- a/src/Gui/ExpressionCompleter.cpp +++ b/src/Gui/ExpressionCompleter.cpp @@ -721,7 +721,7 @@ QStringList ExpressionCompleter::splitPath(const QString& input) const int retry = 0; std::string lastElem; // used to recover in case of parse failure after ".". std::string trim; // used to delete ._self added for another recovery path - while (1) { + while (true) { try { // this will not work for incomplete Tokens at the end // "Sketch." will fail to parse and complete. diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index cd08beb108..20ee5c1834 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -1011,7 +1011,7 @@ void SelectionSingleton::selStackGoForward(int count) { } std::deque tmpStack; _SelStackForward.swap(tmpStack); - while(1) { + while(true) { bool found = false; for(auto &sobjT : _SelStackBack.back()) { if(sobjT.getSubObject()) { diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 6cd159c04d..086b928b01 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -5147,7 +5147,7 @@ App::DocumentObject* DocumentObjectItem::getRelativeParent( auto subname2 = str2.str(); const char* sub = subname.c_str(); const char* sub2 = subname2.c_str(); - while (1) { + while (true) { const char* dot = strchr(sub, '.'); if (!dot) { str.str(""); diff --git a/src/Gui/View3DSettings.cpp b/src/Gui/View3DSettings.cpp index 47826d2904..f16e5e5acb 100644 --- a/src/Gui/View3DSettings.cpp +++ b/src/Gui/View3DSettings.cpp @@ -524,7 +524,7 @@ void NaviCubeSettings::parameterChanged(const char* Name) nc->setBorderWidth(hGrp->GetFloat("BorderWidth", 1.1)); } else if (strcmp(Name, "ShowCS") == 0) { - nc->setShowCS(hGrp->GetBool("ShowCS", 1)); + nc->setShowCS(hGrp->GetBool("ShowCS", true)); } else if (strcmp(Name, "TextTop") == 0 || strcmp(Name, "TextBottom") == 0 || strcmp(Name, "TextFront") == 0 || strcmp(Name, "TextRear") == 0 diff --git a/src/Gui/ViewProviderLink.cpp b/src/Gui/ViewProviderLink.cpp index 9ee75d22fd..2a9d17ae47 100644 --- a/src/Gui/ViewProviderLink.cpp +++ b/src/Gui/ViewProviderLink.cpp @@ -609,7 +609,7 @@ public: return false; auto geoGroup = pcLinked->getObject(); auto sobj = geoGroup; - while(1) { + while(true) { std::string objname = std::string(nextsub,dot-nextsub+1); if(!geoGroup->getSubObject(objname.c_str())) { // this object is not found under the geo group, abort. @@ -1454,7 +1454,7 @@ bool LinkView::linkGetDetailPath(const char *subname, SoFullPath *path, SoDetail if (subname[0]>='0' && subname[0]<='9') { idx = App::LinkBaseExtension::getArrayIndex(subname,&subname); } else { - while(1) { + while(true) { const char *dot = strchr(subname,'.'); if(!dot) break; @@ -3077,7 +3077,7 @@ std::map ViewProviderLink::getElementColors(const char // In case of multi-level linking, we recursively call into each level, // and merge the colors auto vp = this; - while(1) { + while(true) { if(wildcard!=ViewProvider::hiddenMarker() && vp->OverrideMaterial.getValue()) { auto color = ShapeMaterial.getValue().diffuseColor; color.a = ShapeMaterial.getValue().transparency; diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp index 6c2503b904..994d05347e 100644 --- a/src/Gui/WidgetFactory.cpp +++ b/src/Gui/WidgetFactory.cpp @@ -582,7 +582,7 @@ Py::Object PyResource::value(const Py::Tuple& args) item = Py::Float(v.toDouble()); break; case QMetaType::Bool: - item = Py::Boolean(v.toBool() ? 1 : 0); + item = Py::Boolean(v.toBool()); break; case QMetaType::UInt: item = Py::Long(static_cast(v.toUInt())); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp index edb13ea0ce..f8938004d2 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp @@ -97,7 +97,7 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux( std::string constraint_type = pcConstraint->ConstraintType.getValueAsString(); if (constraint_type == "Convection") { - ui->rb_convection->setChecked(1); + ui->rb_convection->setChecked(true); ui->sw_heatflux->setCurrentIndex(0); Base::Quantity t = Base::Quantity(pcConstraint->AmbientTemp.getValue(), Base::Unit::Temperature); @@ -107,7 +107,7 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux( ui->if_filmcoef->setValue(f); } else if (constraint_type == "DFlux") { - ui->rb_dflux->setChecked(1); + ui->rb_dflux->setChecked(true); ui->sw_heatflux->setCurrentIndex(1); Base::Quantity c = Base::Quantity(pcConstraint->DFlux.getValue(), Base::Unit::HeatFlux); ui->if_heatflux->setValue(c); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp index e071eb5da8..ac5c9a9c05 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp @@ -70,14 +70,14 @@ TaskFemConstraintTemperature::TaskFemConstraintTemperature( std::string constraint_type = pcConstraint->ConstraintType.getValueAsString(); if (constraint_type == "Temperature") { - ui->rb_temperature->setChecked(1); + ui->rb_temperature->setChecked(true); ui->if_temperature->setValue(pcConstraint->Temperature.getQuantityValue()); ui->if_temperature->bind(pcConstraint->Temperature); ui->if_temperature->setUnit(pcConstraint->Temperature.getUnit()); } else if (constraint_type == "CFlux") { - ui->rb_cflux->setChecked(1); + ui->rb_cflux->setChecked(true); std::string str = "Concentrated heat flux"; ui->if_temperature->setValue(pcConstraint->CFlux.getQuantityValue()); ui->if_temperature->bind(pcConstraint->CFlux); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp b/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp index 0fefb1a81b..7a07e7f30d 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp @@ -98,13 +98,13 @@ TaskFemConstraintTransform::TaskFemConstraintTransform( std::string transform_type = pcConstraint->TransformType.getValueAsString(); if (transform_type == "Rectangular") { ui->sw_transform->setCurrentIndex(0); - ui->rb_rect->setChecked(1); - ui->rb_cylin->setChecked(0); + ui->rb_rect->setChecked(true); + ui->rb_cylin->setChecked(false); } else if (transform_type == "Cylindrical") { ui->sw_transform->setCurrentIndex(1); - ui->rb_rect->setChecked(0); - ui->rb_cylin->setChecked(1); + ui->rb_rect->setChecked(false); + ui->rb_cylin->setChecked(true); } ui->lw_Rect->clear(); diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp index 4fcb4b171a..c089ac5d99 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp @@ -734,7 +734,7 @@ bool ViewProviderFemPostObject::setupPipeline() // Therefore the only way is the hack to filter only if the used Elmer CPU cores are > 1. auto hGrp = App::GetApplication().GetParameterGroupByPath( "User parameter:BaseApp/Preferences/Mod/Fem/Elmer"); - bool FilterMultiCPUResults = hGrp->GetBool("FilterMultiCPUResults", 1); + bool FilterMultiCPUResults = hGrp->GetBool("FilterMultiCPUResults", true); int UseNumberOfCores = hGrp->GetInt("UseNumberOfCores", 1); // filtering is only necessary for pipelines and warp filters if (FilterMultiCPUResults && (UseNumberOfCores > 1) diff --git a/src/Mod/Import/App/ExportOCAF.cpp b/src/Mod/Import/App/ExportOCAF.cpp index f9f436a409..ea7777495c 100644 --- a/src/Mod/Import/App/ExportOCAF.cpp +++ b/src/Mod/Import/App/ExportOCAF.cpp @@ -184,7 +184,7 @@ void ExportOCAF::createNode(App::Part* part, int& root_id, { TDF_Label shapeLabel = aShapeTool->NewShape(); Handle(TDataStd_Name) N; - TDataStd_Name::Set(shapeLabel, TCollection_ExtendedString(part->Label.getValue(), 1)); + TDataStd_Name::Set(shapeLabel, TCollection_ExtendedString(part->Label.getValue(), true)); Base::Placement pl = part->Placement.getValue(); Base::Rotation rot(pl.getRotation()); @@ -241,7 +241,7 @@ int ExportOCAF::saveShape(Part::Feature* part, const std::vector& co TDF_Label shapeLabel = aShapeTool->NewShape(); aShapeTool->SetShape(shapeLabel, baseShape); - TDataStd_Name::Set(shapeLabel, TCollection_ExtendedString(part->Label.getValue(), 1)); + TDataStd_Name::Set(shapeLabel, TCollection_ExtendedString(part->Label.getValue(), true)); /* diff --git a/src/Mod/Import/App/ImportOCAF2.cpp b/src/Mod/Import/App/ImportOCAF2.cpp index 61611b0107..42c0ffd8a4 100644 --- a/src/Mod/Import/App/ImportOCAF2.cpp +++ b/src/Mod/Import/App/ImportOCAF2.cpp @@ -346,7 +346,7 @@ App::DocumentObject *ImportOCAF2::expandShape( std::vector objs; if(shape.ShapeType() == TopAbs_COMPOUND) { - for(TopoDS_Iterator it(shape,0,0);it.More();it.Next()) { + for(TopoDS_Iterator it(shape,Standard_False,Standard_False);it.More();it.Next()) { TDF_Label childLabel; if(!label.IsNull()) aShapeTool->FindSubShape(label,it.Value(),childLabel); @@ -671,7 +671,7 @@ void ImportOCAF2::getSHUOColors(TDF_Label label, // appendFirst tells us whether we shall append the object name of the first label bool skipFirst = !appendFirst; ss.str(""); - while(1) { + while(true) { if(skipFirst) skipFirst = false; else { @@ -798,7 +798,7 @@ bool ImportOCAF2::createAssembly(App::Document *_doc, if(newDoc) doc = getDocument(_doc,label); - for(TopoDS_Iterator it(shape,0,0);it.More();it.Next()) { + for(TopoDS_Iterator it(shape,Standard_False,Standard_False);it.More();it.Next()) { TopoDS_Shape childShape = it.Value(); if(childShape.IsNull()) continue; @@ -940,7 +940,7 @@ void ExportOCAF2::setName(TDF_Label label, App::DocumentObject *obj, const char return; name = obj->Label.getValue(); } - TDataStd_Name::Set(label, TCollection_ExtendedString(name, 1)); + TDataStd_Name::Set(label, TCollection_ExtendedString(name, true)); } // Similar to XCAFDoc_ShapeTool::FindSHUO but return only main SHUO, i.e. SHUO @@ -1219,7 +1219,7 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, int depth = 0; auto linked = obj; auto linkedShape = shape; - while(1) { + while(true) { auto s = Part::Feature::getTopoShape(linked); if(s.isNull() || !s.getShape().IsPartner(shape.getShape())) break; diff --git a/src/Mod/MeshPart/App/MeshFlatteningLscmRelax.cpp b/src/Mod/MeshPart/App/MeshFlatteningLscmRelax.cpp index 98ee6a6dc2..627145f3de 100644 --- a/src/Mod/MeshPart/App/MeshFlatteningLscmRelax.cpp +++ b/src/Mod/MeshPart/App/MeshFlatteningLscmRelax.cpp @@ -644,7 +644,7 @@ void LscmRelax::rotate_by_min_bound_area() double phi; double min_phi = 0; double min_area = 0; - bool x_dominant = 0; + bool x_dominant = false; // rotate vector by 90 degree and find min area for (int i = 0; i < n + 1; i++ ) { diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index bb468e0d2e..3142cd9984 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -2598,7 +2598,7 @@ void GeomArcOfCircle::Restore(Base::XMLReader &reader) GC_MakeCircle mc(xdir, Radius); if (!mc.IsDone()) THROWM(Base::CADKernelError,gce_ErrorStatusText(mc.Status())) - GC_MakeArcOfCircle ma(mc.Value()->Circ(), StartAngle, EndAngle, 1); + GC_MakeArcOfCircle ma(mc.Value()->Circ(), StartAngle, EndAngle, Standard_True); if (!ma.IsDone()) THROWM(Base::CADKernelError,gce_ErrorStatusText(ma.Status())) @@ -3123,7 +3123,7 @@ void GeomArcOfEllipse::Restore(Base::XMLReader &reader) if (!mc.IsDone()) THROWM(Base::CADKernelError,gce_ErrorStatusText(mc.Status())) - GC_MakeArcOfEllipse ma(mc.Value()->Elips(), StartAngle, EndAngle, 1); + GC_MakeArcOfEllipse ma(mc.Value()->Elips(), StartAngle, EndAngle, Standard_True); if (!ma.IsDone()) THROWM(Base::CADKernelError,gce_ErrorStatusText(ma.Status())) @@ -3549,7 +3549,7 @@ void GeomArcOfHyperbola::Restore(Base::XMLReader &reader) if (!mc.IsDone()) THROWM(Base::CADKernelError,gce_ErrorStatusText(mc.Status())) - GC_MakeArcOfHyperbola ma(mc.Value()->Hypr(), StartAngle, EndAngle, 1); + GC_MakeArcOfHyperbola ma(mc.Value()->Hypr(), StartAngle, EndAngle, Standard_True); if (!ma.IsDone()) THROWM(Base::CADKernelError,gce_ErrorStatusText(ma.Status())) @@ -3901,7 +3901,7 @@ void GeomArcOfParabola::Restore(Base::XMLReader &reader) if (!mc.IsDone()) THROWM(Base::CADKernelError,gce_ErrorStatusText(mc.Status())) - GC_MakeArcOfParabola ma(mc.Value(), StartAngle, EndAngle, 1); + GC_MakeArcOfParabola ma(mc.Value(), StartAngle, EndAngle, Standard_True); if (!ma.IsDone()) THROWM(Base::CADKernelError,gce_ErrorStatusText(ma.Status())) diff --git a/src/Mod/PartDesign/App/FeatureExtrude.cpp b/src/Mod/PartDesign/App/FeatureExtrude.cpp index 2fde0dcfd2..abd1ba0b98 100644 --- a/src/Mod/PartDesign/App/FeatureExtrude.cpp +++ b/src/Mod/PartDesign/App/FeatureExtrude.cpp @@ -177,7 +177,7 @@ void FeatureExtrude::generatePrism(TopoDS_Shape& prism, // see e.g. https://forum.freecad.org/viewtopic.php?p=560785#p560785 // It is better not to use BRepFeat_MakePrism here even if we have a support because the // resulting shape creates problems with Pocket - BRepPrimAPI_MakePrism PrismMaker(from, Ltotal * gp_Vec(direction), 0, 1); // finite prism + BRepPrimAPI_MakePrism PrismMaker(from, Ltotal * gp_Vec(direction), Standard_False, Standard_True); // finite prism if (!PrismMaker.IsDone()) throw Base::RuntimeError("ProfileBased: Length: Could not extrude the sketch!"); prism = PrismMaker.Shape(); diff --git a/src/Mod/PartDesign/App/FeatureHelix.cpp b/src/Mod/PartDesign/App/FeatureHelix.cpp index b35c805da5..9efc0d4544 100644 --- a/src/Mod/PartDesign/App/FeatureHelix.cpp +++ b/src/Mod/PartDesign/App/FeatureHelix.cpp @@ -594,7 +594,7 @@ void Helix::proposeParameters(bool force) Pitch.setValue(pitch); Height.setValue(pitch * 3.0); - HasBeenEdited.setValue(1); + HasBeenEdited.setValue(true); } } diff --git a/src/Mod/PartDesign/App/FeatureHole.cpp b/src/Mod/PartDesign/App/FeatureHole.cpp index ec0b981e3c..d7c7614e0f 100644 --- a/src/Mod/PartDesign/App/FeatureHole.cpp +++ b/src/Mod/PartDesign/App/FeatureHole.cpp @@ -1260,9 +1260,9 @@ void Hole::onChanged(const App::Property* prop) CustomThreadClearance.setReadOnly(true); ThreadDepth.setReadOnly(true); ThreadDepthType.setReadOnly(true); - Threaded.setValue(0); - ModelThread.setValue(0); - UseCustomThreadClearance.setValue(0); + Threaded.setValue(false); + ModelThread.setValue(false); + UseCustomThreadClearance.setValue(false); } else if (type == "ISOMetricProfile") { ThreadSize.setEnums(ThreadSize_ISOmetric_Enums); diff --git a/src/Mod/PartDesign/Gui/Utils.cpp b/src/Mod/PartDesign/Gui/Utils.cpp index f058c11ac2..158caaf9ae 100644 --- a/src/Mod/PartDesign/Gui/Utils.cpp +++ b/src/Mod/PartDesign/Gui/Utils.cpp @@ -279,7 +279,7 @@ void fixSketchSupport (Sketcher::SketchObject* sketch) return; // Sketch is on a face of a solid, do nothing const App::Document* doc = sketch->getDocument(); - PartDesign::Body *body = getBodyFor(sketch, /*messageIfNot*/ 0); + PartDesign::Body *body = getBodyFor(sketch, /*messageIfNot*/ false); if (!body) { throw Base::RuntimeError ("Couldn't find body for the sketch"); } diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index 2f1b78caeb..fde743bd09 100644 --- a/src/Mod/Path/App/Area.cpp +++ b/src/Mod/Path/App/Area.cpp @@ -2203,7 +2203,7 @@ TopoDS_Shape Area::toShape(const CCurve& _c, const gp_Trsf* trsf, int reorient) double r = center.Distance(pt); double r2 = center.Distance(pnext); bool fix_arc = fabs(r - r2) > Precision::Confusion(); - while (1) { + while (true) { if (fix_arc) { double d = pt.Distance(pnext); double rr = r * r; diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index 64c64b0dfa..a8d5a81b1c 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -1216,12 +1216,12 @@ const BaseGeomPtrVector DrawViewPart::getVisibleFaceEdges() const bool DrawViewPart::handleFaces() { - return Preferences::getPreferenceGroup("General")->GetBool("HandleFaces", 1l); + return Preferences::getPreferenceGroup("General")->GetBool("HandleFaces", true); } bool DrawViewPart::newFaceFinder(void) { - return Preferences::getPreferenceGroup("General")->GetBool("NewFaceFinder", 0l); + return Preferences::getPreferenceGroup("General")->GetBool("NewFaceFinder", false); } //! remove features that are useless without this DVP @@ -1699,7 +1699,7 @@ bool DrawViewPart::prefIsoHid() int DrawViewPart::prefIsoCount() { - return Preferences::getPreferenceGroup("HLR")->GetBool("IsoCount", 0); + return Preferences::getPreferenceGroup("HLR")->GetBool("IsoCount", false); } // Python Drawing feature --------------------------------------------------------- diff --git a/src/Mod/TechDraw/Gui/QGIViewPart.cpp b/src/Mod/TechDraw/Gui/QGIViewPart.cpp index 30c5de1244..8066f74922 100644 --- a/src/Mod/TechDraw/Gui/QGIViewPart.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewPart.cpp @@ -1280,7 +1280,7 @@ void QGIViewPart::rotateView() {} bool QGIViewPart::prefFaceEdges() { bool result = false; - result = Preferences::getPreferenceGroup("General")->GetBool("DrawFaceEdges", 0l); + result = Preferences::getPreferenceGroup("General")->GetBool("DrawFaceEdges", false); return result; } diff --git a/src/Mod/TechDraw/Gui/QGVPage.cpp b/src/Mod/TechDraw/Gui/QGVPage.cpp index 803b37349d..18bb6e419a 100644 --- a/src/Mod/TechDraw/Gui/QGVPage.cpp +++ b/src/Mod/TechDraw/Gui/QGVPage.cpp @@ -122,8 +122,8 @@ public: } void init() { - page->m_atCursor = hGrp->GetBool("ZoomAtCursor", 1l); - page->m_invertZoom = hGrp->GetBool("InvertZoom", 0l); + page->m_atCursor = hGrp->GetBool("ZoomAtCursor", true); + page->m_invertZoom = hGrp->GetBool("InvertZoom", false); page->m_zoomIncrement = hGrp->GetFloat("ZoomStep", 0.02); page->m_reversePan = Preferences::getPreferenceGroup("General")->GetInt("KbPan", 1); diff --git a/src/Mod/TechDraw/Gui/TaskLineDecor.cpp b/src/Mod/TechDraw/Gui/TaskLineDecor.cpp index 739cf9f5e5..cb9b9a8679 100644 --- a/src/Mod/TechDraw/Gui/TaskLineDecor.cpp +++ b/src/Mod/TechDraw/Gui/TaskLineDecor.cpp @@ -100,7 +100,7 @@ void TaskLineDecor::getDefaults() m_style = LineFormat::getDefEdgeStyle(); m_color = LineFormat::getDefEdgeColor(); m_weight = LineFormat::getDefEdgeWidth(); - m_visible = 1; + m_visible = true; //set defaults to format of 1st edge if (!m_edges.empty()) { @@ -136,7 +136,7 @@ void TaskLineDecor::getDefaults() m_weight = partVP->LineWidth.getValue(); m_style = Qt::SolidLine; // = 1 m_color = LineFormat::getDefEdgeColor(); - m_visible = 1; + m_visible = true; } } }