Fix missing inits of graph in a few places

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4532
This commit is contained in:
Jon Evans 2020-05-24 19:08:40 -04:00
parent e18a9d4aa3
commit 82a2530863
2 changed files with 4 additions and 0 deletions

View File

@ -1825,6 +1825,7 @@ std::shared_ptr<SCH_CONNECTION> CONNECTION_GRAPH::getDefaultConnection( SCH_ITEM
if( pin->IsPowerConnection() )
{
c = std::make_shared<SCH_CONNECTION>( aItem, aSheet );
c->SetGraph( this );
c->ConfigureFromLabel( pin->GetName() );
}
break;
@ -1837,6 +1838,7 @@ std::shared_ptr<SCH_CONNECTION> CONNECTION_GRAPH::getDefaultConnection( SCH_ITEM
auto text = static_cast<SCH_TEXT*>( aItem );
c = std::make_shared<SCH_CONNECTION>( aItem, aSheet );
c->SetGraph( this );
c->ConfigureFromLabel( text->GetShownText() );
break;
}

View File

@ -146,6 +146,7 @@ void SCH_CONNECTION::ConfigureFromLabel( const wxString& aLabel )
member->m_local_name = vector_member;
member->m_vector_index = i++;
member->SetName( vector_member );
member->SetGraph( m_graph );
m_members.push_back( member );
}
}
@ -212,6 +213,7 @@ void SCH_CONNECTION::Reset()
void SCH_CONNECTION::Clone( SCH_CONNECTION& aOther )
{
m_graph = aOther.m_graph;
m_type = aOther.Type();
m_driver = aOther.Driver();
m_sheet = aOther.Sheet();