Commit 6f33e6da authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

SetName() was broken

parent e7eef8cf
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -710,6 +710,8 @@ void SCH_EDIT_FRAME::SaveSettings()

    m_TemplateFieldNames.Format( &sf, 0 );

    D(printf("saving formatted template fieldnames:'%s'\n", sf.GetString().c_str() );)

    wxString record = FROM_UTF8( sf.GetString().c_str() );
    record.Replace( wxT("\n"), wxT(""), true );   // strip all newlines
    record.Replace( wxT("  "), wxT(" "), true );  // double space to single
+5 −1
Original line number Diff line number Diff line
@@ -631,8 +631,12 @@ void LIB_FIELD::SetName( const wxString& aName )
    // Mandatory field names are fixed.

    // So what?  Why should the low level code be in charge of such a policy issue?
    if( m_id < MANDATORY_FIELDS )
    // Besides, m_id is a relic that is untrustworthy now.
    if( m_id >=0 && m_id < MANDATORY_FIELDS )
    {
        D(printf( "trying to set a MANDATORY_FIELD's name\n" );)
        return;
    }

    if( m_name != aName )
    {
+1 −1

File changed.

Contains only whitespace changes.