diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 878aeb7cda..0dbd9bb5be 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -425,10 +425,11 @@ void DIALOG_ERC::testErc() m_markerTreeModel->SetProvider( m_markerProvider ); // Display new markers from the current screen: - KIGFX::VIEW* view = m_parent->GetCanvas()->GetView(); - - for( auto item : m_parent->GetScreen()->Items().OfType( SCH_MARKER_T ) ) - view->Add( item ); + for( SCH_ITEM* marker : m_parent->GetScreen()->Items().OfType( SCH_MARKER_T ) ) + { + m_parent->GetCanvas()->GetView()->Remove( marker ); + m_parent->GetCanvas()->GetView()->Add( marker ); + } m_parent->GetCanvas()->Refresh(); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index a93dea529a..d37403e469 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -725,18 +725,6 @@ void SCH_EDIT_FRAME::ResolveERCExclusions() else Schematic().RootScreen()->Append( marker ); } - - // Update the view for the current screen - for( SCH_ITEM* item : GetScreen()->Items().OfType( SCH_MARKER_T ) ) - { - SCH_MARKER* marker = static_cast( item ); - - if( marker->IsExcluded() ) - { - GetCanvas()->GetView()->Remove( marker ); - GetCanvas()->GetView()->Add( marker ); - } - } } @@ -1277,7 +1265,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags ) timer.Stop(); wxLogTrace( "CONN_PROFILE", "SchematicCleanUp() %0.4f ms", timer.msecs() ); - if( settings.m_IntersheetRefsShow == true ) + if( settings.m_IntersheetRefsShow ) RecomputeIntersheetRefs(); std::function changeHandler = @@ -1290,7 +1278,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags ) } -int SCH_EDIT_FRAME::RecomputeIntersheetRefs() +void SCH_EDIT_FRAME::RecomputeIntersheetRefs() { std::map>& pageRefsMap = Schematic().GetPageRefsMap(); @@ -1339,9 +1327,6 @@ int SCH_EDIT_FRAME::RecomputeIntersheetRefs() GetCanvas()->GetView()->Update( global ); } } - - GetCanvas()->Refresh(); - return 0; } diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index c221be0f32..b5012feef4 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -932,7 +932,7 @@ public: * so that they are redrawn with up-to-date references. * @return */ - int RecomputeIntersheetRefs(); + void RecomputeIntersheetRefs(); void ShowAllIntersheetRefs( bool aShow );