diff --git a/eeschema/sch_label.h b/eeschema/sch_label.h index 951f74b890..37da117ec6 100644 --- a/eeschema/sch_label.h +++ b/eeschema/sch_label.h @@ -100,6 +100,11 @@ public: m_fields = aFields; // vector copying, length is changed possibly } + void AddFields( const std::vector& aFields ) + { + m_fields.insert( m_fields.end(), aFields.begin(), aFields.end() ); + } + /** * Increment the label text, if it ends with a number. * diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index a340f802c6..f884d6b7dc 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -2165,7 +2165,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) SCH_LABEL_BASE* new_label = dynamic_cast( newtext ); if( label && new_label ) - new_label->SetFields( label->GetFields() ); + new_label->AddFields( label->GetFields() ); if( selected ) m_toolMgr->RunAction( EE_ACTIONS::removeItemFromSel, true, item );