diff --git a/eeschema/sch_io/eagle/sch_io_eagle.cpp b/eeschema/sch_io/eagle/sch_io_eagle.cpp index d25177edda..7f30bbdf08 100644 --- a/eeschema/sch_io/eagle/sch_io_eagle.cpp +++ b/eeschema/sch_io/eagle/sch_io_eagle.cpp @@ -1842,7 +1842,7 @@ void SCH_IO_EAGLE::loadInstance( wxXmlNode* aInstanceNode ) valueField->SetVisible( part->GetFieldById( VALUE_FIELD )->IsVisible() ); - if( !userValue && epart->value ) + if( epart->value ) { valueField->SetText( *epart->value ); } @@ -1954,11 +1954,8 @@ void SCH_IO_EAGLE::loadInstance( wxXmlNode* aInstanceNode ) // Use the instance attribute to determine the reference and value field visibility. if( einstance.smashed && einstance.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 ce3095d5ff..08f6fa8dd9 100644 --- a/eeschema/symbol_editor/symbol_editor_import_export.cpp +++ b/eeschema/symbol_editor/symbol_editor_import_export.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2008 Wayne Stambaugh - * Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2004-2023, 2024 KiCad Developers, see AUTHORS.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 @@ -33,6 +33,7 @@ #include #include #include +#include void SYMBOL_EDIT_FRAME::ImportSymbol() @@ -108,6 +109,12 @@ void SYMBOL_EDIT_FRAME::ImportSymbol() DisplayErrorMessage( this, msg, ioe.What() ); return; } + catch( const XML_PARSER_ERROR& ioe ) + { + msg.Printf( _( "Cannot import symbol library '%s'." ), fn.GetFullPath() ); + DisplayErrorMessage( this, msg, ioe.what() ); + return; + } if( symbols.empty() ) {