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:
parent
966173c129
commit
fb85612f81
|
@ -674,6 +674,7 @@ void SCH_EAGLE_PLUGIN::loadSheet( wxXmlNode* aSheetNode, int aSheetIndex )
|
||||||
if( descriptionNode )
|
if( descriptionNode )
|
||||||
{
|
{
|
||||||
des = descriptionNode->GetContent();
|
des = descriptionNode->GetContent();
|
||||||
|
des.Replace( "\n", "_", true );
|
||||||
m_currentSheet->SetName( des );
|
m_currentSheet->SetName( des );
|
||||||
filename = des.ToStdString();
|
filename = des.ToStdString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,7 +223,14 @@ void SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataVie
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if( node->LibId == m_libMgr->GetCurrentLibId() )
|
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
|
else
|
||||||
aVariant = node->Desc;
|
aVariant = node->Desc;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue