Don't double-escape netnames.

Netnames in wxChoice or wxListBox are already in internal format
and don't need escaping again.

Fixes: lp:1823863
* https://bugs.launchpad.net/kicad/+bug/1823863
This commit is contained in:
Jeff Young 2019-04-12 00:26:49 +01:00
parent 76e0622222
commit 0021ecf51e
6 changed files with 5 additions and 11 deletions

View File

@ -59,14 +59,9 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
}
else if( aContext == CTX_NETNAME )
{
// Currently, modifying a netname creates mubh more issues than it fixes.
// Especially the netnames shown on screen are not those living in netlists
// breaking net info in Spice, Gerber X2 and IPC356 for instance
#if 0
if( c == '/' )
converted += "{slash}";
else
#endif
converted += c;
}
else if( aContext == CTX_LIBID )

View File

@ -189,8 +189,7 @@ public:
}
else
{
wxString netname = EscapeString( selectedNetName, CTX_NETNAME );
NETINFO_ITEM* netInfo = m_netinfoList->GetNetItem( netname );
NETINFO_ITEM* netInfo = m_netinfoList->GetNetItem( selectedNetName );
if( netInfo == nullptr || netInfo->GetNet() == 0 )
{

View File

@ -317,7 +317,7 @@ void GERBVIEW_FRAME::OnSelectHighlightChoice( wxCommandEvent& event )
break;
case ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE:
settings->m_netHighlightString = EscapeString( m_SelNetnameBox->GetStringSelection(), CTX_NETNAME );
settings->m_netHighlightString = m_SelNetnameBox->GetStringSelection();
break;
case ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE:

View File

@ -99,7 +99,7 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
wxString netHighlight;
if( gerbFrame->m_SelNetnameBox->GetSelection() > 0 )
netHighlight = EscapeString( gerbFrame->m_SelNetnameBox->GetStringSelection(), CTX_NETNAME );
netHighlight = gerbFrame->m_SelNetnameBox->GetStringSelection();
wxString aperAttrHighlight = gerbFrame->m_SelAperAttributesBox->GetStringSelection();

View File

@ -396,7 +396,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aUseExportableSetupOnly )
// Search net_code for this net, if a net was selected
if( m_ListNetNameSelection->GetSelection() > 0 )
{
wxString netname = EscapeString( m_ListNetNameSelection->GetStringSelection(), CTX_NETNAME );
wxString netname = m_ListNetNameSelection->GetStringSelection();
net = m_Parent->GetBoard()->FindNet( netname );
}

View File

@ -265,7 +265,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
NETCLASSPTR nc = netclasses.Find( m_membershipGrid->GetCellValue( row, 1 ) );
if( nc )
nc->Add( EscapeString( m_membershipGrid->GetCellValue( row, 0 ), CTX_NETNAME ) );
nc->Add( m_membershipGrid->GetCellValue( row, 0 ) );
}
m_Pcb->SynchronizeNetsAndNetClasses();