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(); IsRoot = aItem->IsRoot();
if( aItem->GetUnitCount() > 1 )
{
for( int u = 1; u <= aItem->GetUnitCount(); ++u ) for( int u = 1; u <= aItem->GetUnitCount(); ++u )
AddUnit( aItem, u ); AddUnit( aItem, u );
}
} }

View File

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