eeschema: Return CONNECTION when initing

This commit is contained in:
Seth Hillbrand 2019-04-05 15:27:09 -07:00 committed by Jon Evans
parent bf051b5c41
commit cf69cb5637
2 changed files with 4 additions and 3 deletions

View File

@ -117,17 +117,18 @@ void SCH_ITEM::AddConnectionTo( SCH_ITEM* aItem )
}
void SCH_ITEM::InitializeConnection( const SCH_SHEET_PATH& aSheet )
SCH_CONNECTION* SCH_ITEM::InitializeConnection( const SCH_SHEET_PATH& aSheet )
{
if( Connection( aSheet ) )
{
Connection( aSheet )->Reset();
return;
return Connection( aSheet );
}
auto connection = new SCH_CONNECTION( this );
connection->SetSheet( aSheet );
m_connection_map.insert( std::make_pair( aSheet, connection ) );
return connection;
}

View File

@ -343,7 +343,7 @@ public:
*
* @param aPath is the sheet path to initialize
*/
void InitializeConnection( const SCH_SHEET_PATH& aPath );
SCH_CONNECTION* InitializeConnection( const SCH_SHEET_PATH& aPath );
/**
* Returns true if this item should propagate connection info to aItem