diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index b0aee5bf3a..9f043c326b 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -269,7 +269,7 @@ bool SCH_CONNECTION::IsDriver() const } -const wxString& SCH_CONNECTION::Name( bool aIgnoreSheet ) const +wxString SCH_CONNECTION::Name( bool aIgnoreSheet ) const { wxASSERT( !m_cached_name.IsEmpty() ); return aIgnoreSheet ? m_cached_name : m_cached_name_with_path; diff --git a/eeschema/sch_connection.h b/eeschema/sch_connection.h index cad56fa6f6..620cd59aad 100644 --- a/eeschema/sch_connection.h +++ b/eeschema/sch_connection.h @@ -153,7 +153,7 @@ public: m_dirty = false; } - const wxString& Name( bool aIgnoreSheet = false ) const; + wxString Name( bool aIgnoreSheet = false ) const; const wxString& RawName() const { diff --git a/eeschema/sch_item.cpp b/eeschema/sch_item.cpp index 8e9fbe5ad4..ca8569a5b0 100644 --- a/eeschema/sch_item.cpp +++ b/eeschema/sch_item.cpp @@ -167,6 +167,8 @@ NETCLASSPTR SCH_ITEM::NetClass() const if( !netclassName.IsEmpty() ) return netSettings.m_NetClasses.Find( netclassName ); + else + return netSettings.m_NetClasses.GetDefault(); } return nullptr; diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index eca8a6030f..89d0404b6d 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -208,9 +208,12 @@ void SCH_LINE::SetLineColor( const double r, const double g, const double b, con COLOR4D SCH_LINE::GetLineColor() const { + if( m_stroke.GetColor() != COLOR4D::UNSPECIFIED ) + return m_stroke.GetColor(); + NETCLASSPTR netclass = NetClass(); - if( netclass && netclass->GetSchematicColor() != COLOR4D::UNSPECIFIED ) + if( netclass ) return netclass->GetSchematicColor(); return m_stroke.GetColor(); @@ -252,6 +255,9 @@ PLOT_DASH_TYPE SCH_LINE::GetLineStyle() const PLOT_DASH_TYPE SCH_LINE::GetEffectiveLineStyle() const { + if( m_stroke.GetType() != PLOT_DASH_TYPE::DEFAULT ) + return m_stroke.GetType(); + NETCLASSPTR netclass = NetClass(); if( netclass ) @@ -823,13 +829,13 @@ void SCH_LINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) conn->AppendInfoToMsgPanel( aList ); NET_SETTINGS& netSettings = Schematic()->Prj().GetProjectFile().NetSettings(); - const wxString& netname = conn->Name( true ); + wxString netname = conn->Name( true ); + wxString netclassName = netSettings.m_NetClasses.GetDefaultPtr()->GetName(); if( netSettings.m_NetClassAssignments.count( netname ) ) - { - const wxString& netclassName = netSettings.m_NetClassAssignments[ netname ]; - aList.push_back( MSG_PANEL_ITEM( _( "Assigned Netclass" ), netclassName, DARKRED ) ); - } + netclassName = netSettings.m_NetClassAssignments[ netname ]; + + aList.push_back( MSG_PANEL_ITEM( _( "Assigned Netclass" ), netclassName, DARKRED ) ); } } }