diff --git a/common/gestfich.cpp b/common/gestfich.cpp index b95892fd49..8a853f7c95 100644 --- a/common/gestfich.cpp +++ b/common/gestfich.cpp @@ -392,17 +392,17 @@ bool OpenPDF( const wxString& file ) void OpenFile( const wxString& file ) { wxString command; - wxString filename = file; - wxFileName CurrentFileName( filename ); - wxString ext, type; + wxFileName currentFileName( file ); + wxString ext; + wxString type; - ext = CurrentFileName.GetExt(); + ext = currentFileName.GetExt(); wxFileType* filetype = wxTheMimeTypesManager->GetFileTypeFromExtension( ext ); bool success = false; - wxFileType::MessageParameters params( filename, type ); + wxFileType::MessageParameters params( file, type ); if( filetype ) success = filetype->GetOpenCommand( &command, params ); diff --git a/cvpcb/dialogs/fp_conflict_assignment_selector.cpp b/cvpcb/dialogs/fp_conflict_assignment_selector.cpp index ef2f180023..0e5b372ee8 100644 --- a/cvpcb/dialogs/fp_conflict_assignment_selector.cpp +++ b/cvpcb/dialogs/fp_conflict_assignment_selector.cpp @@ -79,7 +79,7 @@ void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::OnColumnClick( wxListEvent& event ) // when it is the COL_SELCMP column, set all item choices to cmp file assigment. // when it is the COL_SELSCH column, set all item choices to schematic assigment. - wxListItem item = event.GetItem(); + const wxListItem& item = event.GetItem(); int column = event.GetColumn(); int colclr, colset; diff --git a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp index be6d533f39..e67f715151 100644 --- a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp @@ -319,7 +319,7 @@ bool NETLIST_EXPORTER_PSPICE::ProcessNetlist( unsigned aCtl ) if( fieldSeq ) { // Get the string containing the sequence of nodes: - wxString nodeSeqIndexLineStr = fieldSeq->GetText(); + const wxString& nodeSeqIndexLineStr = fieldSeq->GetText(); // Verify field exists and is not empty: if( !nodeSeqIndexLineStr.IsEmpty() ) diff --git a/eeschema/plot_schematic_PDF.cpp b/eeschema/plot_schematic_PDF.cpp index 6ca854a926..c1a073c162 100644 --- a/eeschema/plot_schematic_PDF.cpp +++ b/eeschema/plot_schematic_PDF.cpp @@ -165,7 +165,7 @@ void DIALOG_PLOT_SCHEMATIC::setupPlotPagePDF( PLOTTER * aPlotter, SCH_SCREEN* aS { PAGE_INFO plotPage; // page size selected to plot // Considerations on page size and scaling requests - PAGE_INFO actualPage = aScreen->GetPageSettings(); // page size selected in schematic + const PAGE_INFO& actualPage = aScreen->GetPageSettings(); // page size selected in schematic switch( m_pageSizeSelect ) { diff --git a/gerbview/printout_control.cpp b/gerbview/printout_control.cpp index 21a758c2c1..c80fe3af42 100644 --- a/gerbview/printout_control.cpp +++ b/gerbview/printout_control.cpp @@ -134,7 +134,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage( const wxString& aLayerName, wxBusyCursor dummy; boardBoundingBox = ((GERBVIEW_FRAME*) m_Parent)->GetGerberLayoutBoundingBox(); - wxString titleblockFilename = aLayerName; // TODO see if we uses the gerber file name + const wxString& titleblockFilename = aLayerName; // TODO see if we uses the gerber file name // Use the page size as the drawing area when the board is shown or the user scale // is less than 1. diff --git a/kicad/tree_project_frame.cpp b/kicad/tree_project_frame.cpp index c2d361dba4..74f9fac469 100644 --- a/kicad/tree_project_frame.cpp +++ b/kicad/tree_project_frame.cpp @@ -919,7 +919,7 @@ wxTreeItemId TREE_PROJECT_FRAME::findSubdirTreeItem( const wxString& aSubDir ) void TREE_PROJECT_FRAME::OnFileSystemEvent( wxFileSystemWatcherEvent& event ) { - wxFileName pathModified = event.GetPath(); + const wxFileName& pathModified = event.GetPath(); wxString subdir = pathModified.GetPath(); wxString fn = pathModified.GetFullPath(); @@ -970,8 +970,8 @@ void TREE_PROJECT_FRAME::OnFileSystemEvent( wxFileSystemWatcherEvent& event ) case wxFSW_EVENT_RENAME : { - wxFileName newpath = event.GetNewPath(); - wxString newfn = newpath.GetFullPath(); + const wxFileName& newpath = event.GetNewPath(); + wxString newfn = newpath.GetFullPath(); while( kid.IsOk() ) { @@ -1057,7 +1057,7 @@ void TREE_PROJECT_FRAME::FileWatcherReset() if( itemData && itemData->GetType() == TREE_DIRECTORY ) { // we can see wxString under a debugger, not a wxFileName - wxString path = itemData->GetFileName(); + const wxString& path = itemData->GetFileName(); wxLogDebug( "%s: add '%s'\n", __func__, TO_UTF8( path ) ); diff --git a/pcbnew/board_netlist_updater.cpp b/pcbnew/board_netlist_updater.cpp index 37ea7ce990..a31cb9c6d8 100644 --- a/pcbnew/board_netlist_updater.cpp +++ b/pcbnew/board_netlist_updater.cpp @@ -573,7 +573,7 @@ bool BOARD_NETLIST_UPDATER::testConnectivity( NETLIST& aNetlist ) // Explore all pins/pads in component for( unsigned jj = 0; jj < component->GetNetCount(); jj++ ) { - COMPONENT_NET net = component->GetNet( jj ); + const COMPONENT_NET& net = component->GetNet( jj ); padname = net.GetPinName(); if( footprint->FindPadByName( padname ) ) diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index cca62f8447..ef65e50bd9 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -2776,7 +2776,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, // Explore all pins/pads in component for( unsigned jj = 0; jj < component->GetNetCount(); jj++ ) { - COMPONENT_NET net = component->GetNet( jj ); + const COMPONENT_NET& net = component->GetNet( jj ); padname = net.GetPinName(); if( footprint->FindPadByName( padname ) ) diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 2c3bcad43b..934c9578dc 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -176,7 +176,7 @@ static bool getNumberingOffset( const wxString& str, DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type, int& offsetToFill ) { - const wxString alphabet = alphabetFromNumberingScheme( type ); + const wxString& alphabet = alphabetFromNumberingScheme( type ); int offset = 0; const int radix = alphabet.length(); diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index 819a0dd861..4edef4426c 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -165,11 +165,11 @@ MODULE* PCB_BASE_FRAME::LoadModuleFromLibrary( const wxString& aLibrary, bool aUseFootprintViewer, wxDC* aDC ) { - MODULE* module = NULL; - wxPoint curspos = GetCrossHairPosition(); - wxString moduleName, keys; - wxString libName = aLibrary; - bool allowWildSeach = true; + MODULE* module = NULL; + wxPoint curspos = GetCrossHairPosition(); + wxString moduleName, keys; + const wxString& libName = aLibrary; + bool allowWildSeach = true; static wxArrayString HistoryList; static wxString lastComponentName; diff --git a/pcbnew/printout_controler.cpp b/pcbnew/printout_controler.cpp index 416a2bf016..a77bd21ddf 100644 --- a/pcbnew/printout_controler.cpp +++ b/pcbnew/printout_controler.cpp @@ -156,7 +156,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage( const wxString& aLayerName, int aPageN BOARD* brd = ((PCB_BASE_FRAME*) m_Parent)->GetBoard(); boardBoundingBox = brd->ComputeBoundingBox(); - wxString titleblockFilename = brd->GetFileName(); + const wxString& titleblockFilename = brd->GetFileName(); // Use the page size as the drawing area when the board is shown or the user scale // is less than 1. diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index 336b2b158f..9013f604ff 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -436,7 +436,7 @@ bool LINE_PLACER::rhMarkObstacles( const VECTOR2I& aP, LINE& aNewHead ) const LINE LINE_PLACER::reduceToNearestObstacle( const LINE& aOriginalLine ) { - auto l0 = aOriginalLine.CLine(); + const auto& l0 = aOriginalLine.CLine(); if ( !l0.PointCount() ) return aOriginalLine; diff --git a/plugins/3d/vrml/x3d.cpp b/plugins/3d/vrml/x3d.cpp index 77f6f5ab57..c6014d81aa 100644 --- a/plugins/3d/vrml/x3d.cpp +++ b/plugins/3d/vrml/x3d.cpp @@ -111,7 +111,7 @@ bool X3DPARSER::getGroupingNodes( wxXmlNode* aNode, std::vector& aRe child != NULL; child = child->GetNext() ) { - wxString name = child->GetName(); + const wxString& name = child->GetName(); if( name == "Transform" || name == "Switch" || name == "Group" ) aResult.push_back( child ); diff --git a/plugins/3d/vrml/x3d/x3d_appearance.cpp b/plugins/3d/vrml/x3d/x3d_appearance.cpp index 876e49f939..35089f7987 100644 --- a/plugins/3d/vrml/x3d/x3d_appearance.cpp +++ b/plugins/3d/vrml/x3d/x3d_appearance.cpp @@ -110,7 +110,7 @@ void X3DAPP::readFields( wxXmlNode* aNode ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "DEF" ) { @@ -163,7 +163,7 @@ bool X3DAPP::Read( wxXmlNode* aNode, X3DNODE* aTopNode, X3D_DICT& aDict ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "DEF" ) { diff --git a/plugins/3d/vrml/x3d/x3d_coords.cpp b/plugins/3d/vrml/x3d/x3d_coords.cpp index 51fe3ba0ae..ed67c9eb62 100644 --- a/plugins/3d/vrml/x3d/x3d_coords.cpp +++ b/plugins/3d/vrml/x3d/x3d_coords.cpp @@ -78,7 +78,7 @@ bool X3DCOORDS::Read( wxXmlNode* aNode, X3DNODE* aTopNode, X3D_DICT& aDict ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "DEF" ) { diff --git a/plugins/3d/vrml/x3d/x3d_ifaceset.cpp b/plugins/3d/vrml/x3d/x3d_ifaceset.cpp index 051b961805..78d5cbee93 100644 --- a/plugins/3d/vrml/x3d/x3d_ifaceset.cpp +++ b/plugins/3d/vrml/x3d/x3d_ifaceset.cpp @@ -100,7 +100,7 @@ void X3DIFACESET::readFields( wxXmlNode* aNode ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "DEF" ) { diff --git a/plugins/3d/vrml/x3d/x3d_ops.cpp b/plugins/3d/vrml/x3d/x3d_ops.cpp index 4ce5c8c265..0a413dc007 100644 --- a/plugins/3d/vrml/x3d/x3d_ops.cpp +++ b/plugins/3d/vrml/x3d/x3d_ops.cpp @@ -42,7 +42,7 @@ bool X3D::ReadTransform( wxXmlNode* aNode, X3DNODE* aParent, X3D_DICT& aDict ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "USE" ) { @@ -89,7 +89,7 @@ bool X3D::ReadShape( wxXmlNode* aNode, X3DNODE* aParent, X3D_DICT& aDict ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "USE" ) { @@ -129,7 +129,7 @@ bool X3D::ReadAppearance( wxXmlNode* aNode, X3DNODE* aParent, X3D_DICT& aDict ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "USE" ) { @@ -169,7 +169,7 @@ bool X3D::ReadIndexedFaceSet( wxXmlNode* aNode, X3DNODE* aParent, X3D_DICT& aDic prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "USE" ) { @@ -209,7 +209,7 @@ bool X3D::ReadCoordinates( wxXmlNode* aNode, X3DNODE* aParent, X3D_DICT& aDict ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "USE" ) { diff --git a/plugins/3d/vrml/x3d/x3d_shape.cpp b/plugins/3d/vrml/x3d/x3d_shape.cpp index e71c7f4b4e..93d07f980b 100644 --- a/plugins/3d/vrml/x3d/x3d_shape.cpp +++ b/plugins/3d/vrml/x3d/x3d_shape.cpp @@ -93,7 +93,7 @@ bool X3DSHAPE::Read( wxXmlNode* aNode, X3DNODE* aTopNode, X3D_DICT& aDict ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "DEF" ) { diff --git a/plugins/3d/vrml/x3d/x3d_transform.cpp b/plugins/3d/vrml/x3d/x3d_transform.cpp index 2108349586..262db573f7 100644 --- a/plugins/3d/vrml/x3d/x3d_transform.cpp +++ b/plugins/3d/vrml/x3d/x3d_transform.cpp @@ -121,7 +121,7 @@ void X3DTRANSFORM::readFields( wxXmlNode* aNode ) prop != NULL; prop = prop->GetNext() ) { - wxString pname = prop->GetName(); + const wxString& pname = prop->GetName(); if( pname == "DEF" ) {