From 4ee14151647200d9155df59a17a09af071663e61 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 22 Jun 2024 12:22:03 -0400 Subject: [PATCH] Fix Eagle schematic importer incorrect symbol value field and visibility. Also fix a crash if an XML_PARSER_ERROR exception is thrown when importing Eagle symbol libraries. Fixes https://gitlab.com/kicad/code/kicad/-/issues/18232 (cherry picked from commit 566fefafc5aa43ad8c0e4057c0d07922bb83b65b) --- eeschema/sch_io/eagle/sch_io_eagle.cpp | 7 ++----- eeschema/symbol_editor/symbol_editor_import_export.cpp | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/eeschema/sch_io/eagle/sch_io_eagle.cpp b/eeschema/sch_io/eagle/sch_io_eagle.cpp index f0510b7f7d..9f80d60840 100644 --- a/eeschema/sch_io/eagle/sch_io_eagle.cpp +++ b/eeschema/sch_io/eagle/sch_io_eagle.cpp @@ -1951,11 +1951,8 @@ void SCH_IO_EAGLE::loadInstance( const std::unique_ptr& aInstance, // Use the instance attribute to determine the reference and value field visibility. if( aInstance->smashed && aInstance->smashed.Get() ) { - if( !valueAttributeFound ) - symbol->GetField( VALUE_FIELD )->SetVisible( false ); - - if( !nameAttributeFound ) - symbol->GetField( REFERENCE_FIELD )->SetVisible( false ); + symbol->GetField( VALUE_FIELD )->SetVisible( valueAttributeFound ); + symbol->GetField( REFERENCE_FIELD )->SetVisible( nameAttributeFound ); } symbol->AddHierarchicalReference( m_sheetPath.Path(), reference, unit ); diff --git a/eeschema/symbol_editor/symbol_editor_import_export.cpp b/eeschema/symbol_editor/symbol_editor_import_export.cpp index 88a287dc1a..1e8df8277a 100644 --- a/eeschema/symbol_editor/symbol_editor_import_export.cpp +++ b/eeschema/symbol_editor/symbol_editor_import_export.cpp @@ -35,6 +35,7 @@ #include #include #include +#include void SYMBOL_EDIT_FRAME::ImportSymbol()