Fix broken if/then/else logic.
Fixes https://gitlab.com/kicad/code/kicad/issues/13192
This commit is contained in:
parent
1ad373f2b2
commit
e64b356d93
|
@ -3839,19 +3839,19 @@ SCH_TEXT* SCH_SEXPR_PARSER::parseSchText()
|
||||||
|
|
||||||
SCH_FIELD* field = parseSchField( text.get() );
|
SCH_FIELD* field = parseSchField( text.get() );
|
||||||
|
|
||||||
if( text->Type() == SCH_GLOBAL_LABEL_T )
|
// If the field is a Intersheetrefs it is not handled like other fields:
|
||||||
|
// It always exists and is the first in list
|
||||||
|
if( text->Type() == SCH_GLOBAL_LABEL_T
|
||||||
|
&& ( field->GetInternalName() == wxT( "Intersheet References" ) // old name in V6.0
|
||||||
|
|| field->GetInternalName() == wxT( "Intersheetrefs" ) ) ) // Current name
|
||||||
{
|
{
|
||||||
// If the field is a Intersheetrefs it is not handled like other fields:
|
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( text.get() );
|
||||||
// It always exists and is the first in list
|
label->GetFields()[0] = *field;
|
||||||
if( field->GetInternalName() == wxT( "Intersheetrefs") || // Current name
|
|
||||||
field->GetInternalName() == wxT( "Intersheet References") ) // old name in V6.0
|
|
||||||
{
|
|
||||||
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( text.get() );
|
|
||||||
label->GetFields()[0] = *field;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
static_cast<SCH_LABEL_BASE*>( text.get() )->GetFields().emplace_back( *field );
|
static_cast<SCH_LABEL_BASE*>( text.get() )->GetFields().emplace_back( *field );
|
||||||
|
}
|
||||||
|
|
||||||
delete field;
|
delete field;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue