diff --git a/eeschema/symbol_library_manager.cpp b/eeschema/symbol_library_manager.cpp index 90fcef1ad0..0b90d14960 100644 --- a/eeschema/symbol_library_manager.cpp +++ b/eeschema/symbol_library_manager.cpp @@ -427,22 +427,21 @@ LIB_SYMBOL* SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol( const wxString& aAlias, if( symbol->IsAlias() ) { std::shared_ptr parent = symbol->GetParent().lock(); - wxCHECK_MSG( parent, nullptr, - wxString::Format( "Derived symbol '%s' found with undefined parent.", - symbol->GetName() ) ); + wxCHECK_MSG( parent, nullptr, wxString::Format( "Derived symbol '%s' found with undefined parent.", + symbol->GetName() ) ); // Check if the parent symbol buffer has already be created. bufferedParent = libBuf.GetSymbol( parent->GetName() ); if( !bufferedParent ) { - auto newParent = std::make_unique( *parent.get() ); + std::unique_ptr newParent = std::make_unique( *parent.get() ); bufferedParent = newParent.get(); libBuf.CreateBuffer( std::move( newParent ), std::make_unique() ); } } - auto newSymbol = std::make_unique( *symbol ); + std::unique_ptr newSymbol = std::make_unique( *symbol ); bufferedSymbol = newSymbol.get(); if( bufferedParent ) @@ -483,9 +482,9 @@ SCH_SCREEN* SYMBOL_LIBRARY_MANAGER::GetScreen( const wxString& aAlias, const wxS bool SYMBOL_LIBRARY_MANAGER::UpdateSymbol( LIB_SYMBOL* aSymbol, const wxString& aLibrary ) { wxCHECK_MSG( aSymbol, false, wxString::Format( "Null symbol in library: %s", aLibrary ) ); - wxCHECK_MSG( LibraryExists( aLibrary ), false, - wxString::Format( "Library missing: %s, for symbol %s", aLibrary, - aSymbol->GetName() ) ); + wxCHECK_MSG( LibraryExists( aLibrary ), false, wxString::Format( "Library missing: %s, for symbol %s", + aLibrary, + aSymbol->GetName() ) ); LIB_BUFFER& libBuf = getLibraryBuffer( aLibrary ); std::shared_ptr symbolBuf = libBuf.GetBuffer( aSymbol->GetName() ); @@ -503,7 +502,7 @@ bool SYMBOL_LIBRARY_MANAGER::UpdateSymbol( LIB_SYMBOL* aSymbol, const wxString& } else // New symbol { - auto symbolCopy = std::make_unique( *aSymbol, nullptr ); + std::unique_ptr symbolCopy = std::make_unique( *aSymbol, nullptr ); symbolCopy->SetLibId( LIB_ID( aLibrary, aSymbol->GetLibId().GetLibItemName() ) ); @@ -795,10 +794,7 @@ std::set SYMBOL_LIBRARY_MANAGER::getOriginalSymbols( const wxString } catch( const IO_ERROR& e ) { - wxString msg; - - msg.Printf( _( "Cannot enumerate library '%s'." ), aLibrary ); - DisplayErrorMessage( &m_frame, msg, e.What() ); + wxLogError( wxString::Format( _( "Cannot enumerate library '%s'." ), aLibrary ), e.What() ); } return symbols; @@ -822,27 +818,25 @@ LIB_BUFFER& SYMBOL_LIBRARY_MANAGER::getLibraryBuffer( const wxString& aLibrary ) { std::shared_ptr oldParent = symbol->GetParent().lock(); - wxCHECK_MSG( oldParent, buf, - wxString::Format( "Derived symbol '%s' found with undefined parent.", - symbol->GetName() ) ); + wxCHECK_MSG( oldParent, buf, wxString::Format( "Derived symbol '%s' found with undefined parent.", + symbol->GetName() ) ); LIB_SYMBOL* libParent = buf.GetSymbol( oldParent->GetName() ); if( !libParent ) { - auto newParent = std::make_unique( *oldParent.get() ); + std::unique_ptr newParent = std::make_unique( *oldParent.get() ); libParent = newParent.get(); buf.CreateBuffer( std::move( newParent ), std::make_unique() ); } - auto newSymbol = std::make_unique( *symbol ); + std::unique_ptr newSymbol = std::make_unique( *symbol ); newSymbol->SetParent( libParent ); buf.CreateBuffer( std::move( newSymbol ), std::make_unique() ); } else if( !buf.GetSymbol( symbol->GetName() ) ) { - buf.CreateBuffer( std::make_unique( *symbol ), - std::make_unique() ); + buf.CreateBuffer( std::make_unique( *symbol ), std::make_unique() ); } }