Escape pin names when used as netnames.

Fixes https://gitlab.com/kicad/code/kicad/issues/11687
This commit is contained in:
Jeff Young 2022-05-26 23:54:23 +01:00
parent 9d90699358
commit 6114a5d72c
1 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@
#include <schematic_settings.h>
#include <sch_sheet_path.h>
#include <sch_edit_frame.h>
#include "string_utils.h"
SCH_PIN::SCH_PIN( LIB_PIN* aLibPin, SCH_SYMBOL* aParentSymbol ) :
SCH_ITEM( aParentSymbol, SCH_PIN_T )
@ -286,13 +286,13 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC
// Pin names might not be unique between different units so we must have the
// unit token in the reference designator
name << GetParentSymbol()->GetRef( &aPath, true );
name << "-" << m_libPin->GetShownName() << ")";
name << "-" << EscapeString( m_libPin->GetShownName(), CTX_NETNAME ) << ")";
}
else
{
// Pin number are unique, so we skip the unit token
// Pin numbers are unique, so we skip the unit token
name << GetParentSymbol()->GetRef( &aPath, false );
name << "-Pad" << m_libPin->GetShownNumber() << ")";
name << "-Pad" << EscapeString( m_libPin->GetShownNumber(), CTX_NETNAME ) << ")";
}
if( annotated )