From 9c173d2b35afe176210a37a35ae329755577a74c Mon Sep 17 00:00:00 2001 From: Benjamin Nauck Date: Thu, 13 Feb 2025 22:11:46 +0100 Subject: [PATCH] Sketcher: Use constant for Type::BadType instead Type::badType() --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 4 ++-- src/Mod/Sketcher/Gui/TaskSketcherElements.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 0706d22c2e..d46109ce7f 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -1526,7 +1526,7 @@ public: selIdPair.GeoId = GeoEnum::GeoUndef; selIdPair.PosId = Sketcher::PointPos::none; std::stringstream ss; - Base::Type newselGeoType = Base::Type::badType(); + Base::Type newselGeoType = Base::Type::BadType; int VtId = getPreselectPoint(); int CrvId = getPreselectCurve(); @@ -1662,7 +1662,7 @@ protected: SelIdPair selIdPair; getIdsFromName(selElement, Obj, selIdPair.GeoId, selIdPair.PosId); - Base::Type newselGeoType = Base::Type::badType(); + Base::Type newselGeoType = Base::Type::BadType; if (isEdge(selIdPair.GeoId, selIdPair.PosId)) { const Part::Geometry* geo = Obj->getGeometry(selIdPair.GeoId); newselGeoType = geo->getTypeId(); diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp index 3d5695a50f..e5df986f5d 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp @@ -463,7 +463,7 @@ private: icons.emplace( std::piecewise_construct, - std::forward_as_tuple(Base::Type::badType()), + std::forward_as_tuple(Base::Type::BadType), std::forward_as_tuple( std::initializer_list< std::pair>> { @@ -479,14 +479,14 @@ private: auto typekey = icons.find(type); if (typekey == icons.end()) {// Not supported Geometry Type - Defaults to invalid icon - typekey = icons.find(Base::Type::badType()); + typekey = icons.find(Base::Type::BadType); pos = Sketcher::PointPos::none; } auto poskey = typekey->second.find(pos); if (poskey == typekey->second.end()) {// invalid PointPos for type - Provide Invalid icon - typekey = icons.find(Base::Type::badType()); + typekey = icons.find(Base::Type::BadType); pos = Sketcher::PointPos::none; poskey = typekey->second.find(pos); }