From 6bf29deb7fa2f94624940dd51763749803a29169 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 31 Oct 2020 17:25:08 +0000 Subject: [PATCH] Improve formatting. --- libs/kimath/include/geometry/shape_compound.h | 4 +++- pcbnew/kicad_clipboard.cpp | 17 +++++++++------- pcbnew/tools/pcb_inspection_tool.cpp | 20 +++++++++++++------ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/libs/kimath/include/geometry/shape_compound.h b/libs/kimath/include/geometry/shape_compound.h index 294e7188e1..8728763592 100644 --- a/libs/kimath/include/geometry/shape_compound.h +++ b/libs/kimath/include/geometry/shape_compound.h @@ -35,7 +35,9 @@ class SHAPE_SIMPLE; class SHAPE_COMPOUND : public SHAPE { public: - SHAPE_COMPOUND() : SHAPE( SH_COMPOUND ), m_dirty( true ) + SHAPE_COMPOUND() : + SHAPE( SH_COMPOUND ), + m_dirty( true ) { } diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index d748f8f66a..bf68e601f2 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -214,8 +214,10 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE copy = static_cast( item->Clone() ); } - auto prepItem = [&]( BOARD_ITEM* titem ) { - // locked means "locked in place"; copied items therefore can't be locked + auto prepItem = [&]( BOARD_ITEM* titem ) + { + // locked means "locked in place"; copied items therefore can't + // be locked if( MODULE* module = dyn_cast( titem ) ) module->SetLocked( false ); else if( TRACK* track = dyn_cast( titem ) ) @@ -234,9 +236,10 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE if( copy->Type() == PCB_GROUP_T ) { static_cast( copy )->RunOnDescendants( prepItem ); - static_cast( copy )->RunOnDescendants( [&]( BOARD_ITEM* titem ) { - Format( titem, 1 ); - } ); + static_cast( copy )->RunOnDescendants( [&]( BOARD_ITEM* titem ) + { + Format( titem, 1 ); + } ); } delete copy; @@ -252,8 +255,8 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE if( !clipboardLock || !clipboard->IsOpened() ) return; - clipboard->SetData( new wxTextDataObject( - wxString( m_formatter.GetString().c_str(), wxConvUTF8 ) ) ); + clipboard->SetData( new wxTextDataObject( wxString( m_formatter.GetString().c_str(), + wxConvUTF8 ) ) ); clipboard->Flush(); diff --git a/pcbnew/tools/pcb_inspection_tool.cpp b/pcbnew/tools/pcb_inspection_tool.cpp index 10aa696e63..74f38f5409 100644 --- a/pcbnew/tools/pcb_inspection_tool.cpp +++ b/pcbnew/tools/pcb_inspection_tool.cpp @@ -975,7 +975,7 @@ void PCB_INSPECTION_TOOL::calculateSelectionRatsnest( const VECTOR2I& aDelta ) if( item->Type() == PCB_MODULE_T ) { - for( auto pad : static_cast( item )->Pads() ) + for( D_PAD* pad : static_cast( item )->Pads() ) { if( pad->GetLocalRatsnestVisible() || displayOptions().m_ShowModuleRatsnest ) items.push_back( pad ); @@ -985,7 +985,9 @@ void PCB_INSPECTION_TOOL::calculateSelectionRatsnest( const VECTOR2I& aDelta ) { PCB_GROUP *group = static_cast( item ); group->RunOnDescendants( [ &queued_items ]( BOARD_ITEM *aItem ) - { queued_items.push_back( aItem );} ); + { + queued_items.push_back( aItem ); + } ); } else if( BOARD_CONNECTED_ITEM* boardItem = dyn_cast( item ) ) { @@ -994,10 +996,16 @@ void PCB_INSPECTION_TOOL::calculateSelectionRatsnest( const VECTOR2I& aDelta ) } } - if( items.empty() || std::none_of( items.begin(), items.end(), []( const BOARD_ITEM* aItem ) - { return( aItem->Type() == PCB_TRACE_T || aItem->Type() == PCB_PAD_T || - aItem->Type() == PCB_ARC_T || aItem->Type() == PCB_ZONE_AREA_T || - aItem->Type() == PCB_MODULE_T || aItem->Type() == PCB_VIA_T ); } ) ) + if( items.empty() || std::none_of( items.begin(), items.end(), + []( const BOARD_ITEM* aItem ) + { + return( aItem->Type() == PCB_TRACE_T + || aItem->Type() == PCB_PAD_T + || aItem->Type() == PCB_ARC_T + || aItem->Type() == PCB_ZONE_AREA_T + || aItem->Type() == PCB_MODULE_T + || aItem->Type() == PCB_VIA_T ); + } ) ) { return; }