From 0021ecf51e49c54a869b989ea0707368a869f408 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 12 Apr 2019 00:26:49 +0100 Subject: [PATCH] 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 --- common/string.cpp | 5 ----- common/widgets/net_selector.cpp | 3 +-- gerbview/events_called_functions.cpp | 2 +- gerbview/gbr_layout.cpp | 2 +- pcbnew/dialogs/dialog_copper_zones.cpp | 2 +- pcbnew/dialogs/panel_setup_netclasses.cpp | 2 +- 6 files changed, 5 insertions(+), 11 deletions(-) diff --git a/common/string.cpp b/common/string.cpp index 7c8ba290cf..cc3ce95a29 100644 --- a/common/string.cpp +++ b/common/string.cpp @@ -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 ) diff --git a/common/widgets/net_selector.cpp b/common/widgets/net_selector.cpp index c3a971c0b7..acf2ec8580 100644 --- a/common/widgets/net_selector.cpp +++ b/common/widgets/net_selector.cpp @@ -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 ) { diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index 0be79b495e..26f0f3d724 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -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: diff --git a/gerbview/gbr_layout.cpp b/gerbview/gbr_layout.cpp index 9c5f5aa397..ccb4d176e2 100644 --- a/gerbview/gbr_layout.cpp +++ b/gerbview/gbr_layout.cpp @@ -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(); diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index f68bb50b0d..56a79320f1 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -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 ); } diff --git a/pcbnew/dialogs/panel_setup_netclasses.cpp b/pcbnew/dialogs/panel_setup_netclasses.cpp index 1e7e3796ac..7d0416e107 100644 --- a/pcbnew/dialogs/panel_setup_netclasses.cpp +++ b/pcbnew/dialogs/panel_setup_netclasses.cpp @@ -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();