From cf69cb563745332d0f8923561606cfae67265d89 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 5 Apr 2019 15:27:09 -0700 Subject: [PATCH] eeschema: Return CONNECTION when initing --- eeschema/sch_item_struct.cpp | 5 +++-- eeschema/sch_item_struct.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_item_struct.cpp b/eeschema/sch_item_struct.cpp index d685ccfdcc..52c38a5fe2 100644 --- a/eeschema/sch_item_struct.cpp +++ b/eeschema/sch_item_struct.cpp @@ -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; } diff --git a/eeschema/sch_item_struct.h b/eeschema/sch_item_struct.h index e61d754f6b..cbe512f913 100644 --- a/eeschema/sch_item_struct.h +++ b/eeschema/sch_item_struct.h @@ -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