diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 88555aaac4..b4eaeec1a5 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -366,6 +366,7 @@ std::set::iterator FindByFirstNFields( std::set& strSet, con { if( searchPrefix[pos] == delimiter ) delimiterCount++; + pos++; } @@ -375,9 +376,7 @@ std::set::iterator FindByFirstNFields( std::set& strSet, con for( auto it = strSet.begin(); it != strSet.end(); ++it ) { if( it->StartsWith( searchPrefix + delimiter ) || *it == searchPrefix ) - { return it; - } } return strSet.end(); @@ -400,24 +399,20 @@ std::vector BOARD::ResolveDRCExclusions( bool aCreateMarkers ) if( !serialized.Contains( "unconnected_items" ) ) { it = exclusions.find( serialized ); + if( it != exclusions.end() ) - { matchedExclusion = *it; - } } else { const int numberOfFieldsExcludingIds = 3; const char delimiter = '|'; it = FindByFirstNFields( exclusions, serialized, delimiter, numberOfFieldsExcludingIds ); + if( it != exclusions.end() ) - { matchedExclusion = *it; - } - else - { - } } + if( it != exclusions.end() ) { marker->SetExcluded( true, comments[matchedExclusion] ); @@ -439,13 +434,12 @@ std::vector BOARD::ResolveDRCExclusions( bool aCreateMarkers ) PCB_MARKER* marker = PCB_MARKER::DeserializeFromString( serialized ); if( !marker ) - { continue; - } std::vector ids = marker->GetRCItem()->GetIDs(); int uuidCount = 0; + for( const KIID& uuid : ids ) { if( uuidCount < 1 || uuid != niluuid ) @@ -1076,7 +1070,8 @@ void BOARD::CacheTriangulation( PROGRESS_REPORTER* aReporter, const std::vector< returns.reserve( zones.size() ); - auto cache_zones = [aReporter]( ZONE* aZone ) -> size_t + auto cache_zones = + [aReporter]( ZONE* aZone ) -> size_t { if( aReporter && aReporter->IsCancelled() ) return 0; @@ -2457,8 +2452,7 @@ BOARD_STACKUP BOARD::GetStackupOrDefault() const std::tuple BOARD::GetTrackLength( const PCB_TRACK& aTrack ) const { - auto connectivity = GetBoard()->GetConnectivity(); - + std::shared_ptr connectivity = GetBoard()->GetConnectivity(); std::vector items; for( BOARD_CONNECTED_ITEM* boardItem : connectivity->GetConnectedItems( &aTrack, EXCLUDE_ZONES ) ) @@ -2675,7 +2669,7 @@ std::set BOARD::GetFonts() const continue; using EMBEDDING_PERMISSION = KIFONT::OUTLINE_FONT::EMBEDDING_PERMISSION; - auto* outline = static_cast( font ); + KIFONT::OUTLINE_FONT* outline = static_cast( font ); if( outline->GetEmbeddingPermission() == EMBEDDING_PERMISSION::EDITABLE || outline->GetEmbeddingPermission() == EMBEDDING_PERMISSION::INSTALLABLE ) @@ -2695,7 +2689,7 @@ void BOARD::EmbedFonts() for( KIFONT::OUTLINE_FONT* font : fonts ) { - auto file = GetEmbeddedFiles()->AddFile( font->GetFileName(), false ); + EMBEDDED_FILES::EMBEDDED_FILE* file = GetEmbeddedFiles()->AddFile( font->GetFileName(), false ); file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::FONT; } } diff --git a/pcbnew/pcb_marker.cpp b/pcbnew/pcb_marker.cpp index 58508016c6..c91e43f5dd 100644 --- a/pcbnew/pcb_marker.cpp +++ b/pcbnew/pcb_marker.cpp @@ -111,11 +111,17 @@ wxString PCB_MARKER::SerializeToString() const else if( m_rcItem->GetErrorCode() == DRCE_UNCONNECTED_ITEMS ) { PCB_LAYER_ID layer = m_layer; + if( m_layer == UNDEFINED_LAYER ) layer = F_Cu; - return wxString::Format( wxT( "%s|%d|%d|%s|%d|%s|%s" ), m_rcItem->GetSettingsKey(), m_Pos.x, m_Pos.y, - LayerName( layer ), GetMarkerType(), m_rcItem->GetMainItemID().AsString(), + return wxString::Format( wxT( "%s|%d|%d|%s|%d|%s|%s" ), + m_rcItem->GetSettingsKey(), + m_Pos.x, + m_Pos.y, + LayerName( layer ), + GetMarkerType(), + m_rcItem->GetMainItemID().AsString(), m_rcItem->GetAuxItemID().AsString() ); } else if( m_rcItem->GetErrorCode() == DRCE_STARVED_THERMAL ) @@ -184,15 +190,11 @@ PCB_MARKER* PCB_MARKER::DeserializeFromString( const wxString& data ) } else if( drcItem->GetErrorCode() == DRCE_UNCONNECTED_ITEMS ) { - // Pre-9.0.3 versions didn't have KIIDs as last two properties to allow sorting stability + // Pre-9.0.4 versions didn't have KIIDs as last two properties to allow sorting stability if( props.size() < 6 ) - { drcItem->SetItems( KIID( props[3] ), KIID( props[4] ) ); - } else - { drcItem->SetItems( KIID( props[5] ), KIID( props[6] ) ); - } } else if( drcItem->GetErrorCode() == DRCE_STARVED_THERMAL ) {