Do not allow trailing/leading whitespace in mandatory fields
Reference, Value, Footprint and Datasheet all reference elements that should not use trailing/leading whitespace or similar hidden charaters. Other fields may utilize leading/trailing whitespace for obscure purposes but won't break functionality as they are display only
This commit is contained in:
parent
edc7603d2a
commit
6dcb9bb664
|
@ -1154,7 +1154,11 @@ void SCH_FIELD::SetText( const wxString& aText )
|
|||
if( m_isNamedVariable )
|
||||
return;
|
||||
|
||||
EDA_TEXT::SetText( aText );
|
||||
// Mandatory fields should not have leading or trailing whitespace.
|
||||
if( IsMandatory() )
|
||||
EDA_TEXT::SetText( aText.Strip( wxString::both ) );
|
||||
else
|
||||
EDA_TEXT::SetText( aText );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue