diff --git a/src/Mod/Import/App/dxf/dxf.cpp b/src/Mod/Import/App/dxf/dxf.cpp index 41f1f064dc..3e780d3e5b 100644 --- a/src/Mod/Import/App/dxf/dxf.cpp +++ b/src/Mod/Import/App/dxf/dxf.cpp @@ -2343,7 +2343,7 @@ bool CDxfRead::ReadDimension() bool CDxfRead::ReadUnknownEntity() { ProcessAllEntityAttributes(); - UnsupportedFeature("Entity type '%s'", m_record_data); + UnsupportedFeature("Entity type '%s'", m_current_entity_name.c_str()); return true; } @@ -2403,7 +2403,8 @@ void CDxfRead::UnsupportedFeature(const char* format, args&&... argValuess) { // NOLINTNEXTLINE(runtime/printf) std::string formattedMessage = fmt::sprintf(format, std::forward(argValuess)...); - m_stats.unsupportedFeatures[formattedMessage].emplace_back(m_line, m_current_entity_handle); + m_stats.unsupportedFeatures[formattedMessage].emplace_back(m_current_entity_line_number, + m_current_entity_handle); } bool CDxfRead::get_next_record() @@ -2796,6 +2797,8 @@ void CDxfRead::ProcessLayerReference(CDxfRead* object, void* target) } bool CDxfRead::ReadEntity() { + m_current_entity_line_number = m_line; + m_current_entity_name = m_record_data; InitializeAttributes(); m_entityAttributes.SetDefaults(); m_current_entity_handle.clear(); diff --git a/src/Mod/Import/App/dxf/dxf.h b/src/Mod/Import/App/dxf/dxf.h index 1625822977..92b3ce472c 100644 --- a/src/Mod/Import/App/dxf/dxf.h +++ b/src/Mod/Import/App/dxf/dxf.h @@ -463,6 +463,8 @@ private: bool m_not_eof = true; int m_line = 0; bool m_repeat_last_record = false; + int m_current_entity_line_number = 0; + std::string m_current_entity_name; std::string m_current_entity_handle; // The scaling from DXF units to millimetres.