Don't display unit in single unit symbols of annotation error message

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11748
This commit is contained in:
Roberto Fernandez Bautista 2022-06-04 16:04:33 +02:00
parent bb2fc2860a
commit ecbf5c1e14
1 changed files with 3 additions and 1 deletions

View File

@ -684,7 +684,9 @@ int SCH_REFERENCE_LIST::CheckAnnotation( ANNOTATION_ERROR_HANDLER aHandler )
else
tmp = wxT( "?" );
if( ( flatList[ii].m_unit > 0 ) && ( flatList[ii].m_unit < 0x7FFFFFFF ) )
if( ( flatList[ii].GetLibPart()->GetUnitCount() > 1 )
&& ( flatList[ii].m_unit > 0 )
&& ( flatList[ii].m_unit < 0x7FFFFFFF ) )
{
msg.Printf( _( "Duplicate items %s%s%s\n" ),
flatList[ii].GetRef(),