Don't delete default intersheetrefs field from global labels.

Fixes https://gitlab.com/kicad/code/kicad/issues/14493
This commit is contained in:
Jeff Young 2023-04-09 11:06:01 +01:00
parent 2025923ef4
commit a226f7fc14
2 changed files with 6 additions and 1 deletions

View File

@ -100,6 +100,11 @@ public:
m_fields = aFields; // vector copying, length is changed possibly
}
void AddFields( const std::vector<SCH_FIELD>& aFields )
{
m_fields.insert( m_fields.end(), aFields.begin(), aFields.end() );
}
/**
* Increment the label text, if it ends with a number.
*

View File

@ -2165,7 +2165,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
SCH_LABEL_BASE* new_label = dynamic_cast<SCH_LABEL_BASE*>( 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 );