From 70d5fccb54dd809d036edf1a9343ef9c6665b793 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 29 Aug 2023 18:29:39 +0100 Subject: [PATCH] {slash}-to-/ comparison special-cases need to run both ways. (The library may be legacy format, or the document may be.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/15540 (cherry picked from commit 86f96d544b7eb537bbf6dfe9ede43e3a9f6eb971) --- eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index aeac182415..1f8c41267f 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp @@ -1495,6 +1495,13 @@ LIB_SYMBOL* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wx if( it == m_cache->m_symbols.end() && aSymbolName.Contains( '/' ) ) it = m_cache->m_symbols.find( EscapeString( aSymbolName, CTX_LEGACY_LIBID ) ); + if( it == m_cache->m_symbols.end() && aSymbolName.Contains( wxT( "{slash}" ) ) ) + { + wxString unescaped = aSymbolName; + unescaped.Replace( wxT( "{slash}" ), wxT( "/" ) ); + it = m_cache->m_symbols.find( unescaped ); + } + if( it == m_cache->m_symbols.end() ) return nullptr;