Revert "Duplicate field names not allowed - throw exception on load"

This reverts commit 9f20816b24.
This commit is contained in:
Roberto Fernandez Bautista 2024-02-22 21:19:07 +01:00
parent e5ef33d227
commit b0b523bfdb
2 changed files with 1 additions and 22 deletions

View File

@ -790,15 +790,6 @@ LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol
CurOffset() );
}
if( LIB_FIELD* existingName = aSymbol->FindField( name ) )
{
if( existingName->GetId() > MANDATORY_FIELDS )
{
THROW_PARSE_ERROR( wxString::Format( _( "Duplicate field '%s'" ), name ),
CurSource(), CurLine(), CurLineNumber(), CurOffset() );
}
}
field->SetName( name );
// Correctly set the ID based on canonical (untranslated) field name

View File

@ -669,19 +669,7 @@ void SCH_LEGACY_PLUGIN_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSymbol,
}
else
{
wxString fieldName = wxEmptyString;
parseQuotedString( fieldName, aReader, line, &line, true ); // Optional.
if( fieldName.IsEmpty() )
return;
if( aSymbol->FindField( fieldName ) != nullptr )
{
SCH_PARSE_ERROR( wxString::Format( _( "Duplicate field '%s'" ), fieldName ),
aReader, line );
}
field->m_name = fieldName;
parseQuotedString( field->m_name, aReader, line, &line, true ); // Optional.
}
}