diff --git a/src/App/GeoFeature.cpp b/src/App/GeoFeature.cpp index 92421cb912..1c96e9e299 100644 --- a/src/App/GeoFeature.cpp +++ b/src/App/GeoFeature.cpp @@ -88,37 +88,43 @@ GeoFeature::getElementName(const char *name, ElementNameType type) const if(!name) return ret; auto prop = getPropertyOfGeometry(); - if(!prop) return std::make_pair("", name); + if (!prop) { + return std::make_pair("", name); + } auto geo = prop->getComplexData(); - if(!geo) return std::make_pair("", name); + if (!geo) { + return std::make_pair("", name); + } return _getElementName(name, geo->getElementName(name)); } -std::pair -GeoFeature::_getElementName(const char *name, const Data::MappedElement &mapped) const +std::pair +GeoFeature::_getElementName(const char* name, const Data::MappedElement& mapped) const { - std::pair ret; + std::pair ret; if (mapped.index && mapped.name) { std::ostringstream ss; - ss << Data::ComplexGeoData::elementMapPrefix() - << mapped.name << '.' << mapped.index; + ss << Data::ComplexGeoData::elementMapPrefix() << mapped.name << '.' << mapped.index; ret.first = ss.str(); mapped.index.appendToStringBuffer(ret.second); - } else if (mapped.name) { -// FC_TRACE("element mapped name " << name << " not found in " << getFullName()); + } + else if (mapped.name) { + // FC_TRACE("element mapped name " << name << " not found in " << getFullName()); ret.first = name; - const char *dot = strrchr(name,'.'); - if(dot) { + const char* dot = strrchr(name, '.'); + if (dot) { // deliberately mangle the old style element name to signal a // missing reference ret.second = Data::MISSING_PREFIX; - ret.second += dot+1; + ret.second += dot + 1; } - } else { + } + else { mapped.index.appendToStringBuffer(ret.second); } + return ret; } diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index e669441deb..b303f2ad50 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -477,17 +477,19 @@ std::pair TopoShape::shapeTypeAndIndex(const char *name) { return std::make_pair(type,idx); } -std::pair -TopoShape::shapeTypeAndIndex(const Data::IndexedName & element) +std::pair TopoShape::shapeTypeAndIndex(const Data::IndexedName& element) { - if (!element) + if (!element) { return std::make_pair(TopAbs_SHAPE, 0); + } static const std::string _subshape("SubShape"); - if (boost::equals(element.getType(), _subshape)) + if (boost::equals(element.getType(), _subshape)) { return std::make_pair(TopAbs_SHAPE, element.getIndex()); + } TopAbs_ShapeEnum shapetype = shapeType(element.getType(), true); - if (shapetype == TopAbs_SHAPE) + if (shapetype == TopAbs_SHAPE) { return std::make_pair(TopAbs_SHAPE, 0); + } return std::make_pair(shapetype, element.getIndex()); } diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index ca3445f354..788648522d 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -1131,7 +1131,7 @@ public: static const std::string& shapeName(TopAbs_ShapeEnum type, bool silent = false); const std::string& shapeName(bool silent = false) const; static std::pair shapeTypeAndIndex(const char* name); - static std::pair shapeTypeAndIndex(const Data::IndexedName &name); + static std::pair shapeTypeAndIndex(const Data::IndexedName &name); Data::MappedName setElementComboName(const Data::IndexedName & element, const std::vector &names,