Eeschema: fix broken symbol library rescue.
Apparently at some point during V5 development, symbol cache library names
were saved by replacing the LIB_ID separator character ':' with '_'. This
caused the cache look up to fail there by skipping the symbol rescue which
could result in broken schematics.
I have no idea where this happened during V5 development. The video demo
in the HEAD of the 5.1 branch shows the issue. All of the other demo cache
libraries are correct.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10488
(cherry picked from commit c6c4f9ae4b
)
This commit is contained in:
parent
662fb40605
commit
35f85dd900
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Chris Pavlina <pavlina.chris@gmail.com>
|
||||
* Copyright (C) 2015-2021 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2015-2022 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -89,7 +89,6 @@ static void getSymbols( SCHEMATIC* aSchematic, std::vector<SCH_SYMBOL*>& aSymbol
|
|||
static LIB_SYMBOL* findSymbol( const wxString& aName, SYMBOL_LIBS* aLibs, bool aCached )
|
||||
{
|
||||
LIB_SYMBOL *symbol = nullptr;
|
||||
// wxString new_name = LIB_ID::FixIllegalChars( aName, false );
|
||||
|
||||
for( SYMBOL_LIB& each_lib : *aLibs )
|
||||
{
|
||||
|
@ -101,6 +100,17 @@ static LIB_SYMBOL* findSymbol( const wxString& aName, SYMBOL_LIBS* aLibs, bool a
|
|||
|
||||
symbol = each_lib.FindSymbol( aName );
|
||||
|
||||
// At some point during V5 development, the LIB_ID delimiter character ':' was
|
||||
// replaced by '_' when writing the symbol cache library so we have to test for
|
||||
// the LIB_NICKNAME_LIB_SYMBOL_NAME case.
|
||||
if( symbol == nullptr && each_lib.IsCache() )
|
||||
{
|
||||
wxString name = aName;
|
||||
|
||||
if( name.Replace( wxT( ":" ), wxT( "_" ) ) )
|
||||
symbol = each_lib.FindSymbol( name );
|
||||
}
|
||||
|
||||
if( symbol )
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue