eagle: Strip newlines from description

Eeschema old format is line-terminated so the newlines in descriptions
will break the schematic file if saved.

Fixes: lp:1829707
* https://bugs.launchpad.net/kicad/+bug/1829707
This commit is contained in:
Seth Hillbrand 2019-06-07 22:06:41 -07:00
parent 966173c129
commit fb85612f81
2 changed files with 9 additions and 1 deletions

View File

@ -674,6 +674,7 @@ void SCH_EAGLE_PLUGIN::loadSheet( wxXmlNode* aSheetNode, int aSheetIndex )
if( descriptionNode )
{
des = descriptionNode->GetContent();
des.Replace( "\n", "_", true );
m_currentSheet->SetName( des );
filename = des.ToStdString();
}

View File

@ -223,7 +223,14 @@ void SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataVie
case 1:
if( node->LibId == m_libMgr->GetCurrentLibId() )
aVariant = m_libMgr->GetAlias( node->Name, node->Parent->Name )->GetDescription();
{
auto alias = m_libMgr->GetAlias( node->Name, node->Parent->Name );
if( alias )
aVariant = alias->GetDescription();
else
aVariant = node->Desc;
}
else
aVariant = node->Desc;
break;