Make sure symbols have a valid lib nickname...

... even if the library pointer isn't set.

Also fixes the "every symbol as a Unit A" issue.

Fixes: lp:1785438
* https://bugs.launchpad.net/kicad/+bug/1785438
This commit is contained in:
Jeff Young 2018-08-05 14:03:23 +01:00
parent 146ab1eb32
commit 08bcec9ac0
2 changed files with 7 additions and 4 deletions

View File

@ -157,8 +157,11 @@ LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID( LIB_TREE_NODE* aParent, LIB_TREE_ITE
IsRoot = aItem->IsRoot();
for( int u = 1; u <= aItem->GetUnitCount(); ++u )
AddUnit( aItem, u );
if( aItem->GetUnitCount() > 1 )
{
for( int u = 1; u <= aItem->GetUnitCount(); ++u )
AddUnit( aItem, u );
}
}

View File

@ -101,7 +101,7 @@ wxString LIB_ALIAS::GetLibNickname() const
if( shared )
return shared->GetLibraryName();
return wxString( _( "none" ) );
return wxEmptyString;
}
@ -263,7 +263,7 @@ const wxString LIB_PART::GetLibraryName()
if( m_library )
return m_library->GetName();
return wxString( _( "none" ) );
return m_libId.GetLibNickname();
}