Formatting.

This commit is contained in:
Jeff Young 2025-06-25 11:43:27 -06:00
parent f4b1a15cd8
commit 1b81f78152
2 changed files with 19 additions and 23 deletions

View File

@ -366,6 +366,7 @@ std::set<wxString>::iterator FindByFirstNFields( std::set<wxString>& strSet, con
{ {
if( searchPrefix[pos] == delimiter ) if( searchPrefix[pos] == delimiter )
delimiterCount++; delimiterCount++;
pos++; pos++;
} }
@ -375,9 +376,7 @@ std::set<wxString>::iterator FindByFirstNFields( std::set<wxString>& strSet, con
for( auto it = strSet.begin(); it != strSet.end(); ++it ) for( auto it = strSet.begin(); it != strSet.end(); ++it )
{ {
if( it->StartsWith( searchPrefix + delimiter ) || *it == searchPrefix ) if( it->StartsWith( searchPrefix + delimiter ) || *it == searchPrefix )
{
return it; return it;
}
} }
return strSet.end(); return strSet.end();
@ -400,24 +399,20 @@ std::vector<PCB_MARKER*> BOARD::ResolveDRCExclusions( bool aCreateMarkers )
if( !serialized.Contains( "unconnected_items" ) ) if( !serialized.Contains( "unconnected_items" ) )
{ {
it = exclusions.find( serialized ); it = exclusions.find( serialized );
if( it != exclusions.end() ) if( it != exclusions.end() )
{
matchedExclusion = *it; matchedExclusion = *it;
}
} }
else else
{ {
const int numberOfFieldsExcludingIds = 3; const int numberOfFieldsExcludingIds = 3;
const char delimiter = '|'; const char delimiter = '|';
it = FindByFirstNFields( exclusions, serialized, delimiter, numberOfFieldsExcludingIds ); it = FindByFirstNFields( exclusions, serialized, delimiter, numberOfFieldsExcludingIds );
if( it != exclusions.end() ) if( it != exclusions.end() )
{
matchedExclusion = *it; matchedExclusion = *it;
}
else
{
}
} }
if( it != exclusions.end() ) if( it != exclusions.end() )
{ {
marker->SetExcluded( true, comments[matchedExclusion] ); marker->SetExcluded( true, comments[matchedExclusion] );
@ -439,13 +434,12 @@ std::vector<PCB_MARKER*> BOARD::ResolveDRCExclusions( bool aCreateMarkers )
PCB_MARKER* marker = PCB_MARKER::DeserializeFromString( serialized ); PCB_MARKER* marker = PCB_MARKER::DeserializeFromString( serialized );
if( !marker ) if( !marker )
{
continue; continue;
}
std::vector<KIID> ids = marker->GetRCItem()->GetIDs(); std::vector<KIID> ids = marker->GetRCItem()->GetIDs();
int uuidCount = 0; int uuidCount = 0;
for( const KIID& uuid : ids ) for( const KIID& uuid : ids )
{ {
if( uuidCount < 1 || uuid != niluuid ) if( uuidCount < 1 || uuid != niluuid )
@ -1076,7 +1070,8 @@ void BOARD::CacheTriangulation( PROGRESS_REPORTER* aReporter, const std::vector<
returns.reserve( zones.size() ); returns.reserve( zones.size() );
auto cache_zones = [aReporter]( ZONE* aZone ) -> size_t auto cache_zones =
[aReporter]( ZONE* aZone ) -> size_t
{ {
if( aReporter && aReporter->IsCancelled() ) if( aReporter && aReporter->IsCancelled() )
return 0; return 0;
@ -2457,8 +2452,7 @@ BOARD_STACKUP BOARD::GetStackupOrDefault() const
std::tuple<int, double, double, double, double> BOARD::GetTrackLength( const PCB_TRACK& aTrack ) const std::tuple<int, double, double, double, double> BOARD::GetTrackLength( const PCB_TRACK& aTrack ) const
{ {
auto connectivity = GetBoard()->GetConnectivity(); std::shared_ptr<CONNECTIVITY_DATA> connectivity = GetBoard()->GetConnectivity();
std::vector<LENGTH_DELAY_CALCULATION_ITEM> items; std::vector<LENGTH_DELAY_CALCULATION_ITEM> items;
for( BOARD_CONNECTED_ITEM* boardItem : connectivity->GetConnectedItems( &aTrack, EXCLUDE_ZONES ) ) for( BOARD_CONNECTED_ITEM* boardItem : connectivity->GetConnectedItems( &aTrack, EXCLUDE_ZONES ) )
@ -2675,7 +2669,7 @@ std::set<KIFONT::OUTLINE_FONT*> BOARD::GetFonts() const
continue; continue;
using EMBEDDING_PERMISSION = KIFONT::OUTLINE_FONT::EMBEDDING_PERMISSION; using EMBEDDING_PERMISSION = KIFONT::OUTLINE_FONT::EMBEDDING_PERMISSION;
auto* outline = static_cast<KIFONT::OUTLINE_FONT*>( font ); KIFONT::OUTLINE_FONT* outline = static_cast<KIFONT::OUTLINE_FONT*>( font );
if( outline->GetEmbeddingPermission() == EMBEDDING_PERMISSION::EDITABLE if( outline->GetEmbeddingPermission() == EMBEDDING_PERMISSION::EDITABLE
|| outline->GetEmbeddingPermission() == EMBEDDING_PERMISSION::INSTALLABLE ) || outline->GetEmbeddingPermission() == EMBEDDING_PERMISSION::INSTALLABLE )
@ -2695,7 +2689,7 @@ void BOARD::EmbedFonts()
for( KIFONT::OUTLINE_FONT* font : fonts ) 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; file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::FONT;
} }
} }

View File

@ -111,11 +111,17 @@ wxString PCB_MARKER::SerializeToString() const
else if( m_rcItem->GetErrorCode() == DRCE_UNCONNECTED_ITEMS ) else if( m_rcItem->GetErrorCode() == DRCE_UNCONNECTED_ITEMS )
{ {
PCB_LAYER_ID layer = m_layer; PCB_LAYER_ID layer = m_layer;
if( m_layer == UNDEFINED_LAYER ) if( m_layer == UNDEFINED_LAYER )
layer = F_Cu; layer = F_Cu;
return wxString::Format( wxT( "%s|%d|%d|%s|%d|%s|%s" ), m_rcItem->GetSettingsKey(), m_Pos.x, m_Pos.y, return wxString::Format( wxT( "%s|%d|%d|%s|%d|%s|%s" ),
LayerName( layer ), GetMarkerType(), m_rcItem->GetMainItemID().AsString(), m_rcItem->GetSettingsKey(),
m_Pos.x,
m_Pos.y,
LayerName( layer ),
GetMarkerType(),
m_rcItem->GetMainItemID().AsString(),
m_rcItem->GetAuxItemID().AsString() ); m_rcItem->GetAuxItemID().AsString() );
} }
else if( m_rcItem->GetErrorCode() == DRCE_STARVED_THERMAL ) 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 ) 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 ) if( props.size() < 6 )
{
drcItem->SetItems( KIID( props[3] ), KIID( props[4] ) ); drcItem->SetItems( KIID( props[3] ), KIID( props[4] ) );
}
else else
{
drcItem->SetItems( KIID( props[5] ), KIID( props[6] ) ); drcItem->SetItems( KIID( props[5] ), KIID( props[6] ) );
}
} }
else if( drcItem->GetErrorCode() == DRCE_STARVED_THERMAL ) else if( drcItem->GetErrorCode() == DRCE_STARVED_THERMAL )
{ {