diff --git a/eeschema/sch_component.h b/eeschema/sch_component.h index 3de9331746..64516ec22c 100644 --- a/eeschema/sch_component.h +++ b/eeschema/sch_component.h @@ -374,11 +374,6 @@ public: */ bool ReplaceInstanceSheetPath( const KIID_PATH& aOldSheetPath, const KIID_PATH& aNewSheetPath ); - /** - * Clear the HIGHLIGHTED flag of all items of the component (fields, pins ...) - */ - bool ClearAllHighlightFlags(); - const EDA_RECT GetBoundingBox() const override; /** diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 31859909c4..10dd6d5d84 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -1458,6 +1458,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) m_frame->OnModify(); } } + break; case SCH_MARKER_T: // These items have no properties to edit case SCH_NO_CONNECT_T: diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 968078e0fd..225668b139 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -1,8 +1,3 @@ -/** - * @file class_board.cpp - * @brief BOARD class functions. - */ - /* * This program source code file is part of KiCad, a free EDA CAD application. * @@ -33,14 +28,9 @@ #include #include #include -#include -#include #include -#include #include #include -#include -#include #include #include #include diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp index ad235c39a7..47ac131860 100644 --- a/pcbnew/class_dimension.cpp +++ b/pcbnew/class_dimension.cpp @@ -25,20 +25,13 @@ */ #include -#include #include -#include -#include -#include #include #include - #include #include #include #include -#include // for KiROUND -#include #include #include diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 5b4f46b330..130d0b62c7 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -28,17 +28,12 @@ #include #include #include -#include -#include #include #include -#include #include #include #include #include -#include // for KiROUND -#include #include #include diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index 300bba6943..568442eae3 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -24,22 +24,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file class_edge_mod.cpp - * @brief EDGE_MODULE class definition. - */ - #include -#include -#include -#include -#include -#include -#include -#include #include #include // for KiROUND -#include #include #include #include @@ -202,14 +189,12 @@ void EDGE_MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight ) break; case S_POLYGON: - // polygon corners coordinates are always relative to the - // footprint position, orientation 0 + // polygon corners coordinates are relative to the footprint position, orientation 0 m_Poly.Mirror( aFlipLeftRight, !aFlipLeftRight ); break; } - // DRAWSEGMENT items are not usually on copper layers, but - // it can happen in microwave apps. + // DRAWSEGMENT items are not usually on copper layers, but it can happen in microwave apps. // However, currently, only on Front or Back layers. // So the copper layers count is not taken in account SetLayer( FlipLayer( GetLayer() ) ); @@ -272,13 +257,11 @@ void EDGE_MODULE::Mirror( wxPoint aCentre, bool aMirrorAroundXAxis ) void EDGE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle ) { - // We should rotate the relative coordinates, but to avoid duplicate code, - // do the base class rotation of draw coordinates, which is acceptable - // because in module editor, m_Pos0 = m_Pos + // We should rotate the relative coordinates, but to avoid duplicate code do the base class + // rotation of draw coordinates, which is acceptable because in module editor, m_Pos0 = m_Pos DRAWSEGMENT::Rotate( aRotCentre, aAngle ); - // and now update the relative coordinates, which are - // the reference in most transforms. + // and now update the relative coordinates, which are the reference in most transforms. SetLocalCoord(); } diff --git a/pcbnew/class_marker_pcb.cpp b/pcbnew/class_marker_pcb.cpp index a9876056f8..48f0013f68 100644 --- a/pcbnew/class_marker_pcb.cpp +++ b/pcbnew/class_marker_pcb.cpp @@ -25,13 +25,10 @@ #include #include -#include -#include #include #include #include #include -#include #include #include #include diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index fe415f5646..446e83fefd 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -26,21 +26,13 @@ #include #include -#include -#include #include -#include -#include #include -#include -#include #include -#include #include #include #include #include -#include #include MODULE::MODULE( BOARD* parent ) : @@ -101,13 +93,11 @@ MODULE::MODULE( const MODULE& aModule ) : m_Value->SetParent( this ); // Copy auxiliary data: Pads - for( auto pad : aModule.Pads() ) - { + for( D_PAD* pad : aModule.Pads() ) Add( new D_PAD( *pad ) ); - } // Copy auxiliary data: Zones - for( auto item : aModule.Zones() ) + for( MODULE_ZONE_CONTAINER* item : aModule.Zones() ) { Add( static_cast( item->Clone() ) ); @@ -119,7 +109,7 @@ MODULE::MODULE( const MODULE& aModule ) : } // Copy auxiliary data: Drawings - for( auto item : aModule.GraphicalItems() ) + for( BOARD_ITEM* item : aModule.GraphicalItems() ) { switch( item->Type() ) { @@ -157,17 +147,17 @@ MODULE::~MODULE() delete m_Value; delete m_initial_comments; - for( auto p : m_pads ) + for( D_PAD* p : m_pads ) delete p; m_pads.clear(); - for( auto p : m_fp_zones ) + for( MODULE_ZONE_CONTAINER* p : m_fp_zones ) delete p; m_fp_zones.clear(); - for( auto d : m_drawings ) + for( BOARD_ITEM* d : m_drawings ) delete d; m_drawings.clear(); @@ -207,15 +197,13 @@ MODULE& MODULE::operator=( const MODULE& aOther ) // Copy auxiliary data: Pads m_pads.clear(); - for( auto pad : aOther.Pads() ) - { + for( D_PAD* pad : aOther.Pads() ) Add( new D_PAD( *pad ) ); - } // Copy auxiliary data: Zones m_fp_zones.clear(); - for( auto item : aOther.Zones() ) + for( MODULE_ZONE_CONTAINER* item : aOther.Zones() ) { Add( static_cast( item->Clone() ) ); @@ -229,7 +217,7 @@ MODULE& MODULE::operator=( const MODULE& aOther ) // Copy auxiliary data: Drawings m_drawings.clear(); - for( auto item : aOther.GraphicalItems() ) + for( BOARD_ITEM* item : aOther.GraphicalItems() ) { switch( item->Type() ) { @@ -422,16 +410,16 @@ EDA_RECT MODULE::GetFootprintRect() const area.SetEnd( m_Pos ); area.Inflate( Millimeter2iu( 0.25 ) ); // Give a min size to the area - for( auto item : m_drawings ) + for( BOARD_ITEM* item : m_drawings ) { if( item->Type() == PCB_MODULE_EDGE_T ) area.Merge( item->GetBoundingBox() ); } - for( auto pad : m_pads ) + for( D_PAD* pad : m_pads ) area.Merge( pad->GetBoundingBox() ); - for( auto zone : m_fp_zones ) + for( MODULE_ZONE_CONTAINER* zone : m_fp_zones ) area.Merge( zone->GetBoundingBox() ); return area; @@ -465,7 +453,7 @@ const EDA_RECT MODULE::GetBoundingBox() const EDA_RECT area = GetFootprintRect(); // Add in items not collected by GetFootprintRect(): - for( auto item : m_drawings ) + for( BOARD_ITEM* item : m_drawings ) { if( item->Type() != PCB_MODULE_EDGE_T ) area.Merge( item->GetBoundingBox() ); @@ -483,7 +471,7 @@ const EDA_RECT MODULE::GetBoundingBox( bool aIncludeInvisibleText ) const EDA_RECT area = GetFootprintRect(); // Add in items not collected by GetFootprintRect(): - for( auto item : m_drawings ) + for( BOARD_ITEM* item : m_drawings ) { if( item->Type() != PCB_MODULE_EDGE_T ) area.Merge( item->GetBoundingBox() ); @@ -634,19 +622,19 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co return false; // Determine if any elements in the MODULE intersect the rect - for( auto pad : m_pads ) + for( D_PAD* pad : m_pads ) { if( pad->HitTest( arect, false, 0 ) ) return true; } - for( auto zone : m_fp_zones ) + for( MODULE_ZONE_CONTAINER* zone : m_fp_zones ) { if( zone->HitTest( arect, false, 0 ) ) return true; } - for( auto item : m_drawings ) + for( BOARD_ITEM* item : m_drawings ) { if( item->HitTest( arect, false, 0 ) ) return true; @@ -660,7 +648,7 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co D_PAD* MODULE::FindPadByName( const wxString& aPadName ) const { - for( auto pad : m_pads ) + for( D_PAD* pad : m_pads ) { if( pad->GetName() == aPadName ) return pad; @@ -672,7 +660,7 @@ D_PAD* MODULE::FindPadByName( const wxString& aPadName ) const D_PAD* MODULE::GetPad( const wxPoint& aPosition, LSET aLayerMask ) { - for( auto pad : m_pads ) + for( D_PAD* pad : m_pads ) { // ... and on the correct layer. if( !( pad->GetLayerSet() & aLayerMask ).any() ) @@ -690,7 +678,7 @@ D_PAD* MODULE::GetTopLeftPad() { D_PAD* topLeftPad = GetFirstPad(); - for( auto p : m_pads ) + for( D_PAD* p : m_pads ) { wxPoint pnt = p->GetPosition(); // GetPosition() returns the center of the pad @@ -712,7 +700,7 @@ unsigned MODULE::GetPadCount( INCLUDE_NPTH_T aIncludeNPTH ) const unsigned cnt = 0; - for( auto pad : m_pads ) + for( D_PAD* pad : m_pads ) { if( pad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED ) continue; @@ -729,7 +717,7 @@ unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const std::set usedNames; // Create a set of used pad numbers - for( auto pad : m_pads ) + for( D_PAD* pad : m_pads ) { // Skip pads not on copper layers (used to build complex // solder paste shapes for instance) @@ -877,13 +865,13 @@ void MODULE::RunOnChildren( const std::function& aFunction ) { try { - for( auto pad : m_pads ) + for( D_PAD* pad : m_pads ) aFunction( static_cast( pad ) ); - for( auto zone : m_fp_zones ) + for( MODULE_ZONE_CONTAINER* zone : m_fp_zones ) aFunction( static_cast( zone ) ); - for( auto drawing : m_drawings ) + for( BOARD_ITEM* drawing : m_drawings ) aFunction( static_cast( drawing ) ); aFunction( static_cast( m_Reference ) ); @@ -900,14 +888,12 @@ void MODULE::GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads { std::unordered_set layers; - for( auto item : m_drawings ) - { + for( BOARD_ITEM* item : m_drawings ) layers.insert( static_cast( item->GetLayer() ) ); - } if( aIncludePads ) { - for( auto pad : m_pads ) + for( D_PAD* pad : m_pads ) { int pad_layers[KIGFX::VIEW::VIEW_MAX_LAYERS], pad_layers_count; pad->ViewGetLayers( pad_layers, pad_layers_count ); @@ -920,7 +906,7 @@ void MODULE::GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads aCount = layers.size(); int i = 0; - for( auto layer : layers ) + for( int layer : layers ) aLayers[i++] = layer; } @@ -932,7 +918,6 @@ void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const switch( m_Layer ) { - default: wxASSERT_MSG( false, "Illegal layer" ); // do you really have modules placed on other layers? KI_FALLTHROUGH; @@ -1052,7 +1037,7 @@ void MODULE::Rotate( const wxPoint& aRotCentre, double aAngle ) m_Reference->KeepUpright( orientation, newOrientation ); m_Value->KeepUpright( orientation, newOrientation ); - for( auto item : m_drawings ) + for( BOARD_ITEM* item : m_drawings ) { if( item->Type() == PCB_MODULE_TEXT_T ) static_cast( item )->KeepUpright( orientation, newOrientation ); diff --git a/pcbnew/class_pcb_target.cpp b/pcbnew/class_pcb_target.cpp index ef70750884..7ec5e669d2 100644 --- a/pcbnew/class_pcb_target.cpp +++ b/pcbnew/class_pcb_target.cpp @@ -31,17 +31,11 @@ #include #include -#include -#include -#include -#include -#include #include #include #include #include #include -#include #include #include diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index da843f0f04..6a3d17dacf 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -32,19 +32,15 @@ #include #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include -#include "pcb_painter.h" +#include using KIGFX::PCB_RENDER_SETTINGS; diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 7c40e1f3b0..1b51f6393d 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -24,25 +24,16 @@ */ #include -#include -#include #include #include -#include -#include -#include #include -#include #include #include #include #include #include -#include -#include #include #include -#include TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, TEXT_TYPE text_type ) : BOARD_ITEM( parent, PCB_MODULE_TEXT_T ), diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index f40b0e5b3f..c98c49df90 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -25,18 +25,12 @@ */ #include -//#include -#include #include #include #include -#include #include -#include #include #include -#include // for KiROUND -#include #include #include diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 117d957fe0..602764fa79 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -26,22 +26,11 @@ #include #include #include -#include -#include -#include #include #include -#include -#include -#include #include #include -#include -#include #include -#include -#include // for KiROUND -#include #include #include