From 861589d837fd4a0417e0b841703a5e78af6d971c Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 9 Feb 2022 10:33:52 -0800 Subject: [PATCH] Use wxEmptyString instead of wxT( "" ) Also fixes places where ternaries did autopromotion instead of returning an empty wxString --- 3d-viewer/3d_cache/3d_plugin_manager.cpp | 2 +- common/advanced_config.cpp | 6 +-- common/config_params.cpp | 4 +- common/dialogs/dialog_paste_special.cpp | 2 +- common/dialogs/panel_setup_severities.cpp | 6 +-- common/drawing_sheet/ds_painter.cpp | 4 +- common/eda_pattern_match.cpp | 4 +- common/env_paths.cpp | 2 +- common/filename_resolver.cpp | 16 +++--- common/gal/opengl/opengl_gal.cpp | 2 +- common/gbr_metadata.cpp | 2 +- common/hotkeys_basic.cpp | 4 +- common/paths.cpp | 2 +- common/pgm_base.cpp | 2 +- common/plotters/GERBER_plotter.cpp | 2 +- common/plugins/altium/altium_parser.h | 2 +- .../plugins/cadstar/cadstar_archive_parser.h | 2 +- common/preview_items/ruler_item.cpp | 2 +- common/settings/json_settings.cpp | 2 +- common/single_top.cpp | 2 +- common/string_utils.cpp | 4 +- common/widgets/footprint_choice.cpp | 8 +-- common/widgets/wx_progress_reporters.cpp | 2 +- cvpcb/auto_associate.cpp | 4 +- eeschema/dialogs/dialog_field_properties.cpp | 2 +- eeschema/dialogs/dialog_rescue_each.cpp | 2 +- eeschema/files-io.cpp | 2 +- eeschema/sch_edit_frame.cpp | 2 +- .../sch_plugins/altium/altium_parser_sch.cpp | 50 +++++++++--------- .../sch_plugins/altium/sch_altium_plugin.cpp | 4 +- .../sch_plugins/eagle/sch_eagle_plugin.cpp | 9 ++-- eeschema/symbol_editor/symbol_edit_frame.cpp | 2 +- .../symbol_editor/symbol_library_manager.cpp | 6 +-- eeschema/tools/ee_inspection_tool.cpp | 2 +- eeschema/tools/sch_editor_control.cpp | 2 +- .../dialogs/dialog_select_one_pcb_layer.cpp | 2 +- include/widgets/mathplot.h | 2 +- kicad/kicad_manager_frame.cpp | 2 +- .../dialogs/dialog_manage_repositories.cpp | 2 +- kicad/pcm/pcm.cpp | 6 +-- kicad/project_tree_pane.cpp | 2 +- pcbnew/board_design_settings.cpp | 2 +- pcbnew/dialogs/dialog_board_reannotate.cpp | 2 +- pcbnew/dialogs/dialog_board_statistics.cpp | 2 +- pcbnew/dialogs/dialog_export_idf.cpp | 2 +- pcbnew/dialogs/dialog_export_vrml.cpp | 2 +- .../dialog_global_edit_text_and_graphics.cpp | 2 +- pcbnew/dialogs/dialog_text_properties.cpp | 2 +- pcbnew/dialogs/panel_fp_editor_defaults.cpp | 4 +- pcbnew/dialogs/panel_fp_lib_table.cpp | 8 +-- .../dialogs/panel_fp_properties_3d_model.cpp | 6 +-- .../dialogs/panel_setup_text_and_graphics.cpp | 4 +- pcbnew/exporters/export_vrml.cpp | 8 +-- pcbnew/footprint_edit_frame.h | 2 +- pcbnew/footprint_editor_settings.cpp | 2 +- pcbnew/footprint_wizard_frame.cpp | 2 +- .../netlist_reader/board_netlist_updater.cpp | 4 +- pcbnew/plugins/altium/altium_parser_pcb.cpp | 52 +++++++++---------- .../cadstar/cadstar_pcb_archive_loader.cpp | 4 +- pcbnew/plugins/pcad/pcb.cpp | 2 +- pcbnew/plugins/pcad/pcb_text.cpp | 2 +- qa/common/libeval/test_numeric_evaluator.cpp | 2 +- qa/pns/pns_log_viewer.cpp | 8 +-- utils/kicad2step/pcb/3d_resolver.cpp | 8 +-- utils/kicad2step/pcb/kicadpcb.cpp | 2 +- 65 files changed, 162 insertions(+), 159 deletions(-) diff --git a/3d-viewer/3d_cache/3d_plugin_manager.cpp b/3d-viewer/3d_cache/3d_plugin_manager.cpp index f2d2bbaa03..09f4f557a1 100644 --- a/3d-viewer/3d_cache/3d_plugin_manager.cpp +++ b/3d-viewer/3d_cache/3d_plugin_manager.cpp @@ -324,7 +324,7 @@ void S3D_PLUGIN_MANAGER::checkPluginPath( const wxString& aPath, if( aPath.StartsWith( wxT( "${" ) ) || aPath.StartsWith( wxT( "$(" ) ) ) path.Assign( ExpandEnvVarSubstitutions( aPath, nullptr ), wxEmptyString ); else - path.Assign( aPath, wxT( "" ) ); + path.Assign( aPath, wxEmptyString ); path.Normalize(); diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index a652bd18a2..9e2d8570be 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -324,7 +324,7 @@ void ADVANCED_CFG::loadFromConfigFile() wxLogTrace( AdvancedConfigMask, wxT( "Loading advanced config from: %s" ), k_advanced.GetFullPath() ); - wxFileConfig file_cfg( wxT( "" ), wxT( "" ), k_advanced.GetFullPath() ); + wxFileConfig file_cfg( wxEmptyString, wxEmptyString, k_advanced.GetFullPath() ); loadSettings( file_cfg ); } @@ -414,8 +414,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) // Special case for trace mask setting...we just grab them and set them immediately // Because we even use wxLogTrace inside of advanced config - wxString traceMasks = wxT( "" ); - configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks, wxT( "" ) ) ); + wxString traceMasks = wxEmptyString; + configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks, wxEmptyString ) ); // Load the config from file wxConfigLoadSetups( &aCfg, configParams ); diff --git a/common/config_params.cpp b/common/config_params.cpp index fcf02e5a3c..1c2311ea4a 100644 --- a/common/config_params.cpp +++ b/common/config_params.cpp @@ -404,7 +404,7 @@ void PARAM_CFG_WXSTRING_SET::ReadParam( wxConfigBase* aConfig ) const key = m_Ident; key << i; - data = aConfig->Read( key, wxT( "" ) ); + data = aConfig->Read( key, wxEmptyString ); if( data.IsEmpty() ) break; @@ -494,7 +494,7 @@ void PARAM_CFG_LIBNAME_LIST::ReadParam( wxConfigBase* aConfig ) const id_lib = m_Ident; id_lib << indexlib; indexlib++; - libname = aConfig->Read( id_lib, wxT( "" ) ); + libname = aConfig->Read( id_lib, wxEmptyString ); if( libname.IsEmpty() ) break; diff --git a/common/dialogs/dialog_paste_special.cpp b/common/dialogs/dialog_paste_special.cpp index 79fd5fcbd0..37079051a0 100644 --- a/common/dialogs/dialog_paste_special.cpp +++ b/common/dialogs/dialog_paste_special.cpp @@ -38,7 +38,7 @@ DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent, "any designators that already exist in the design." ) ); m_pasteOptions->SetItemToolTip( static_cast( PASTE_MODE::KEEP_ANNOTATIONS ), - wxT( "" ) ); // Self explanatory + wxEmptyString ); // Self explanatory m_pasteOptions->SetItemToolTip( static_cast( PASTE_MODE::REMOVE_ANNOTATIONS ), wxString::Format( _( "Replaces reference designators " diff --git a/common/dialogs/panel_setup_severities.cpp b/common/dialogs/panel_setup_severities.cpp index 9a9ca3f785..218d70e22f 100644 --- a/common/dialogs/panel_setup_severities.cpp +++ b/common/dialogs/panel_setup_severities.cpp @@ -111,7 +111,7 @@ PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES( PAGED_DIALOG* aParent, if( m_pinMapSpecialCase ) { - wxString pinMapSeverities[] = { _( "From Pin Conflicts Map" ), wxT( "" ), _( "Ignore" ) }; + wxString pinMapSeverities[] = { _( "From Pin Conflicts Map" ), wxEmptyString, _( "Ignore" ) }; int errorCode = m_pinMapSpecialCase->GetErrorCode(); wxString msg = m_pinMapSpecialCase->GetErrorText(); @@ -123,9 +123,9 @@ PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES( PAGED_DIALOG* aParent, for( size_t i = 0; i < 3; ++i ) { - if( pinMapSeverities[i] == wxT( "" ) ) + if( pinMapSeverities[i] == wxEmptyString ) { - wxStaticText* spacer = new wxStaticText( radioPanel, wxID_ANY, wxT( "" ) ); + wxStaticText* spacer = new wxStaticText( radioPanel, wxID_ANY, wxEmptyString ); radioSizer->Add( spacer, 0, wxRIGHT | wxEXPAND, 17 ); } else diff --git a/common/drawing_sheet/ds_painter.cpp b/common/drawing_sheet/ds_painter.cpp index 7976286dc6..1989dd3ecd 100644 --- a/common/drawing_sheet/ds_painter.cpp +++ b/common/drawing_sheet/ds_painter.cpp @@ -142,12 +142,12 @@ wxString DS_DRAW_ITEM_LIST::BuildFullText( const wxString& aTextbase ) } else if( token->IsSameAs( wxT( "PAPER" ) ) ) { - *token = m_paperFormat ? *m_paperFormat : wxString( wxT( "" ) ); + *token = m_paperFormat ? *m_paperFormat : wxString( wxEmptyString ); tokenUpdated = true; } else if( token->IsSameAs( wxT( "LAYER" ) ) ) { - *token = m_sheetLayer ? *m_sheetLayer : wxString( wxT( "" ) ); + *token = m_sheetLayer ? *m_sheetLayer : wxString( wxEmptyString ); tokenUpdated = true; } else if( m_titleBlock ) diff --git a/common/eda_pattern_match.cpp b/common/eda_pattern_match.cpp index 720e1451eb..77ef764d11 100644 --- a/common/eda_pattern_match.cpp +++ b/common/eda_pattern_match.cpp @@ -234,7 +234,7 @@ bool EDA_PATTERN_MATCH_RELATIONAL::SetPattern( const wxString& aPattern ) else return false; - if( val == wxT( "" ) ) + if( val == wxEmptyString ) { // Matching on empty values keeps the match list from going empty when // the user types the relational operator character, which helps prevent @@ -337,7 +337,7 @@ const std::map EDA_PATTERN_MATCH_RELATIONAL::m_units = { { wxT( "n" ), 1e-9 }, { wxT( "u" ), 1e-6 }, { wxT( "m" ), 1e-3 }, - { wxT( "" ), 1. }, + { wxEmptyString, 1. }, { wxT( "k" ), 1e3 }, { wxT( "meg" ),1e6 }, { wxT( "g" ), 1e9 }, diff --git a/common/env_paths.cpp b/common/env_paths.cpp index 277fb2caf7..f5020c78aa 100644 --- a/common/env_paths.cpp +++ b/common/env_paths.cpp @@ -141,7 +141,7 @@ wxString NormalizePath( const wxFileName& aFilePath, const ENV_VAR_MAP* aEnvVars if( aProject ) return NormalizePath( aFilePath, aEnvVars, aProject->GetProjectPath() ); else - return NormalizePath( aFilePath, aEnvVars, wxT( "" ) ); + return NormalizePath( aFilePath, aEnvVars, wxEmptyString ); } diff --git a/common/filename_resolver.cpp b/common/filename_resolver.cpp index 20124c4920..a4f0f5f24d 100644 --- a/common/filename_resolver.cpp +++ b/common/filename_resolver.cpp @@ -64,7 +64,7 @@ bool FILENAME_RESOLVER::Set3DConfigDir( const wxString& aConfigDir ) if( aConfigDir.empty() ) return false; - wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), wxT( "" ) ); + wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), wxEmptyString ); cfgdir.Normalize(); @@ -85,7 +85,7 @@ bool FILENAME_RESOLVER::SetProject( PROJECT* aProject, bool* flgChanged ) if( !aProject ) return false; - wxFileName projdir( ExpandEnvVarSubstitutions( aProject->GetProjectPath(), aProject ), wxT( "" ) ); + wxFileName projdir( ExpandEnvVarSubstitutions( aProject->GetProjectPath(), aProject ), wxEmptyString ); projdir.Normalize(); @@ -188,7 +188,7 @@ bool FILENAME_RESOLVER::createPathList() } else { - fndummy.Assign( pathVal, wxT( "" ) ); + fndummy.Assign( pathVal, wxEmptyString ); fndummy.Normalize(); lpath.m_Pathexp = fndummy.GetFullPath(); } @@ -308,7 +308,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) // users can potentially override a model within ${KICAD6_3DMODEL_DIR}. if( !m_paths.begin()->m_Pathexp.empty() && !tname.StartsWith( wxT( ":" ) ) ) { - tmpFN.Assign( m_paths.begin()->m_Pathexp, wxT( "" ) ); + tmpFN.Assign( m_paths.begin()->m_Pathexp, wxEmptyString ); wxString fullPath = tmpFN.GetPathWithSep() + tname; fullPath = ExpandEnvVarSubstitutions( fullPath, m_project ); @@ -420,7 +420,7 @@ bool FILENAME_RESOLVER::addPath( const SEARCH_PATH& aPath ) tpath.m_Pathvar.erase( tpath.m_Pathvar.length() - 1 ); #endif - wxFileName path( ExpandEnvVarSubstitutions( tpath.m_Pathvar, m_project ), wxT( "" ) ); + wxFileName path( ExpandEnvVarSubstitutions( tpath.m_Pathvar, m_project ), wxEmptyString ); path.Normalize(); @@ -713,7 +713,7 @@ void FILENAME_RESOLVER::checkEnvVarPath( const wxString& aPath ) SEARCH_PATH lpath; lpath.m_Alias = envar; lpath.m_Pathvar = lpath.m_Alias; - wxFileName tmpFN( ExpandEnvVarSubstitutions( lpath.m_Alias, m_project ), wxT( "" ) ); + wxFileName tmpFN( ExpandEnvVarSubstitutions( lpath.m_Alias, m_project ), wxEmptyString ); wxUniChar psep = tmpFN.GetPathSeparator(); tmpFN.Normalize(); @@ -768,11 +768,11 @@ wxString FILENAME_RESOLVER::ShortenPath( const wxString& aFullPathName ) continue; } - fpath.Assign( tpath, wxT( "" ) ); + fpath.Assign( tpath, wxEmptyString ); } else { - fpath.Assign( sL->m_Pathexp, wxT( "" ) ); + fpath.Assign( sL->m_Pathexp, wxEmptyString ); } wxString fps = fpath.GetPathWithSep(); diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 63356abcc0..406f38eb27 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -336,7 +336,7 @@ wxString OPENGL_GAL::CheckFeatures( GAL_DISPLAY_OPTIONS& aOptions ) { wxString retVal = wxEmptyString; - wxFrame* testFrame = new wxFrame( nullptr, wxID_ANY, wxT( "" ), wxDefaultPosition, + wxFrame* testFrame = new wxFrame( nullptr, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 1, 1 ), wxFRAME_TOOL_WINDOW | wxNO_BORDER ); KIGFX::OPENGL_GAL* opengl_gal = nullptr; diff --git a/common/gbr_metadata.cpp b/common/gbr_metadata.cpp index 9ca2d971f6..ecf634fd51 100644 --- a/common/gbr_metadata.cpp +++ b/common/gbr_metadata.cpp @@ -536,7 +536,7 @@ std::string FormatStringToGerber( const wxString& aString ) // Netname and Pan num fields cannot be empty in Gerber files // Normalized names must be used, if any #define NO_NET_NAME wxT( "N/C" ) // net name of not connected pads (one pad net) (normalized) -#define NO_PAD_NAME wxT( "" ) // pad name of pads without pad name/number (not normalized) +#define NO_PAD_NAME wxEmptyString // pad name of pads without pad name/number (not normalized) bool FormatNetAttribute( std::string& aPrintedText, std::string& aLastNetAttributes, diff --git a/common/hotkeys_basic.cpp b/common/hotkeys_basic.cpp index db4f4ebf33..4fa11f9ddd 100644 --- a/common/hotkeys_basic.cpp +++ b/common/hotkeys_basic.cpp @@ -112,14 +112,14 @@ static struct hotkey_name_descr hotkeyNameList[] = { wxT( "Num Pad /" ), WXK_NUMPAD_DIVIDE }, { wxT( "Num Pad ." ), WXK_NUMPAD_SEPARATOR }, - { wxT( "" ), 0 }, + { wxEmptyString, 0 }, { wxT( "Click" ), PSEUDO_WXK_CLICK }, { wxT( "DblClick" ), PSEUDO_WXK_DBLCLICK }, { wxT( "Wheel" ), PSEUDO_WXK_WHEEL }, // Do not change this line: end of list - { wxT( "" ), KEY_NON_FOUND } + { wxEmptyString, KEY_NON_FOUND } }; diff --git a/common/paths.cpp b/common/paths.cpp index 3f6c74df5a..462a3d0846 100644 --- a/common/paths.cpp +++ b/common/paths.cpp @@ -263,7 +263,7 @@ wxString PATHS::GetStockPlugins3DPath() // KICAD_PLUGINDIR = CMAKE_INSTALL_FULL_LIBDIR path is the absolute path // corresponding to the install path used for constructing KICAD_USER_PLUGIN wxString tfname = wxString::FromUTF8Unchecked( KICAD_PLUGINDIR ); - fn.Assign( tfname, wxT( "" ) ); + fn.Assign( tfname, wxEmptyString ); fn.AppendDir( wxT( "kicad" ) ); fn.AppendDir( wxT( "plugins" ) ); #elif defined( __WXMAC__ ) diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 2a1d5ec000..0ab414b61d 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -98,7 +98,7 @@ LANGUAGE_DESCR LanguagesList[] = wxT( "简体中文" ), true }, { wxLANGUAGE_CHINESE_TRADITIONAL, ID_LANGUAGE_CHINESE_TRADITIONAL, wxT( "繁體中文" ), false }, - { 0, 0, wxT( "" ), false } // Sentinel + { 0, 0, wxEmptyString, false } // Sentinel }; #undef _ #define _(s) wxGetTranslation((s)) diff --git a/common/plotters/GERBER_plotter.cpp b/common/plotters/GERBER_plotter.cpp index bc8d41e3d3..ae0b4b6c57 100644 --- a/common/plotters/GERBER_plotter.cpp +++ b/common/plotters/GERBER_plotter.cpp @@ -250,7 +250,7 @@ bool GERBER_PLOTTER::StartPlot() // Create a temp file in system temp to avoid potential network share buffer issues for // the final read and save. - m_workFilename = wxFileName::CreateTempFileName( wxT( "" ) ); + m_workFilename = wxFileName::CreateTempFileName( wxEmptyString ); workFile = wxFopen( m_workFilename, wxT( "wt" )); m_outputFile = workFile; wxASSERT( m_outputFile ); diff --git a/common/plugins/altium/altium_parser.h b/common/plugins/altium/altium_parser.h index e682678cfb..9a39543061 100644 --- a/common/plugins/altium/altium_parser.h +++ b/common/plugins/altium/altium_parser.h @@ -80,7 +80,7 @@ public: else { m_error = true; - return wxString( wxT( "" ) ); + return wxString( wxEmptyString ); } } diff --git a/common/plugins/cadstar/cadstar_archive_parser.h b/common/plugins/cadstar/cadstar_archive_parser.h index 5fa81a3737..81a11be438 100644 --- a/common/plugins/cadstar/cadstar_archive_parser.h +++ b/common/plugins/cadstar/cadstar_archive_parser.h @@ -1403,7 +1403,7 @@ public: { return aRefName + ( ( aAlternateName.size() > 0 ) ? ( wxT( " (" ) + aAlternateName + wxT( ")" ) ) - : wxT( "" ) ); + : wxString() ); } diff --git a/common/preview_items/ruler_item.cpp b/common/preview_items/ruler_item.cpp index 13bb91f0b6..ee00e84f9b 100644 --- a/common/preview_items/ruler_item.cpp +++ b/common/preview_items/ruler_item.cpp @@ -221,7 +221,7 @@ void drawTicksAlongLine( KIGFX::VIEW* aView, const VECTOR2D& aOrigin, const VECT if( drawLabel ) { - wxString label = DimensionLabel( wxT( "" ), tickSpace * i, aUnits, false ); + wxString label = DimensionLabel( wxEmptyString, tickSpace * i, aUnits, false ); gal->SetLineWidth( textThickness ); gal->StrokeText( label, tickPos + labelOffset, labelAngle ); } diff --git a/common/settings/json_settings.cpp b/common/settings/json_settings.cpp index 59922cfd41..0b68ae4138 100644 --- a/common/settings/json_settings.cpp +++ b/common/settings/json_settings.cpp @@ -183,7 +183,7 @@ bool JSON_SETTINGS::LoadFromFile( const wxString& aDirectory ) wxLogNull doNotLog; wxConfigBase::DontCreateOnDemand(); - auto cfg = std::make_unique( wxT( "" ), wxT( "" ), aPath.GetFullPath() ); + auto cfg = std::make_unique( wxEmptyString, wxEmptyString, aPath.GetFullPath() ); // If migrate fails or is not implemented, fall back to built-in defaults that were // already loaded above diff --git a/common/single_top.cpp b/common/single_top.cpp index 84e88e5838..f8569802d0 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -335,7 +335,7 @@ bool PGM_SINGLE_TOP::OnPgmInit() } frameTypes[] = { { wxT( "pcb" ), FRAME_PCB_EDITOR }, { wxT( "fpedit" ), FRAME_FOOTPRINT_EDITOR }, - { wxT( "" ), FRAME_T_COUNT } + { wxEmptyString, FRAME_T_COUNT } }; wxString frameName; diff --git a/common/string_utils.cpp b/common/string_utils.cpp index d661ea762d..0511378a0f 100644 --- a/common/string_utils.cpp +++ b/common/string_utils.cpp @@ -149,7 +149,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) if( c == '/' ) converted += wxT( "{slash}" ); else if( c == '\n' || c == '\r' ) - converted += wxT( "" ); // drop + converted += wxEmptyString; // drop else converted += c; } @@ -170,7 +170,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) else if( c == '\"' ) converted += wxT( "{dblquote}" ); else if( c == '\n' || c == '\r' ) - converted += wxT( "" ); // drop + converted += wxEmptyString; // drop else converted += c; } diff --git a/common/widgets/footprint_choice.cpp b/common/widgets/footprint_choice.cpp index 001dd9d6a1..409f436805 100644 --- a/common/widgets/footprint_choice.cpp +++ b/common/widgets/footprint_choice.cpp @@ -123,7 +123,7 @@ void FOOTPRINT_CHOICE::OnDrawItem( wxDC& aDC, wxRect const& aRect, int aItem, in wxCoord FOOTPRINT_CHOICE::OnMeasureItem( size_t aItem ) const { - if( SafeGetString( aItem ) == wxT( "" ) ) + if( SafeGetString( aItem ) == wxEmptyString ) return 11; else return wxOwnerDrawnComboBox::OnMeasureItem( aItem ); @@ -132,7 +132,7 @@ wxCoord FOOTPRINT_CHOICE::OnMeasureItem( size_t aItem ) const wxCoord FOOTPRINT_CHOICE::OnMeasureItemWidth( size_t aItem ) const { - if( SafeGetString( aItem ) == wxT( "" ) ) + if( SafeGetString( aItem ) == wxEmptyString ) return GetTextRect().GetWidth() - 2; else return wxOwnerDrawnComboBox::OnMeasureItemWidth( aItem ); @@ -150,7 +150,7 @@ void FOOTPRINT_CHOICE::TryVetoMouse( wxMouseEvent& aEvent ) { int item = GetVListBoxComboPopup()->VirtualHitTest( aEvent.GetPosition().y ); - if( SafeGetString( item ) != wxT( "" ) ) + if( SafeGetString( item ) != wxEmptyString ) aEvent.Skip(); } @@ -163,7 +163,7 @@ void FOOTPRINT_CHOICE::TryVetoSelect( wxCommandEvent& aEvent, bool aInner ) { wxString text = SafeGetString( sel ); - if( text == wxT( "" ) ) + if( text == wxEmptyString ) { SetSelectionEither( aInner, m_last_selection ); } diff --git a/common/widgets/wx_progress_reporters.cpp b/common/widgets/wx_progress_reporters.cpp index a14620a703..1a3c323559 100644 --- a/common/widgets/wx_progress_reporters.cpp +++ b/common/widgets/wx_progress_reporters.cpp @@ -33,7 +33,7 @@ WX_PROGRESS_REPORTER::WX_PROGRESS_REPORTER( wxWindow* aParent, const wxString& a int aNumPhases, bool aCanAbort, bool aReserveSpaceForMessage ) : PROGRESS_REPORTER_BASE( aNumPhases ), - wxProgressDialog( aTitle, ( aReserveSpaceForMessage ? wxT( " " ) : wxT( "" ) ), 1, aParent, + wxProgressDialog( aTitle, ( aReserveSpaceForMessage ? wxT( " " ) : wxEmptyString ), 1, aParent, // wxPD_APP_MODAL | // Don't use; messes up OSX when called from // quasi-modal dialog wxPD_AUTO_HIDE | // *MUST* use; otherwise wxWidgets will spin diff --git a/cvpcb/auto_associate.cpp b/cvpcb/auto_associate.cpp index e677a6fa55..c7962ccfa7 100644 --- a/cvpcb/auto_associate.cpp +++ b/cvpcb/auto_associate.cpp @@ -55,13 +55,13 @@ wxString GetQuotedText( wxString& text ) int i = text.Find( QUOTE ); if( wxNOT_FOUND == i ) - return wxT( "" ); + return wxEmptyString; wxString shrt = text.Mid( i + 1 ); i = shrt.Find( QUOTE ); if( wxNOT_FOUND == i ) - return wxT( "" ); + return wxEmptyString; text = shrt.Mid( i + 1 ); return shrt.Mid( 0, i ); diff --git a/eeschema/dialogs/dialog_field_properties.cpp b/eeschema/dialogs/dialog_field_properties.cpp index edd2e0518f..a55a4438df 100644 --- a/eeschema/dialogs/dialog_field_properties.cpp +++ b/eeschema/dialogs/dialog_field_properties.cpp @@ -399,7 +399,7 @@ void DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded( wxStyledTextEvent &aEven { wxString text = m_StyledTextCtrl->GetText(); int currpos = m_StyledTextCtrl->GetCurrentPos(); - text.Replace( wxT( "\n" ), wxT( "" ) ); + text.Replace( wxT( "\n" ), wxEmptyString ); m_StyledTextCtrl->SetText( text ); m_StyledTextCtrl->GotoPos( currpos-1 ); return; diff --git a/eeschema/dialogs/dialog_rescue_each.cpp b/eeschema/dialogs/dialog_rescue_each.cpp index 713a0d1c02..1c0a4f112c 100644 --- a/eeschema/dialogs/dialog_rescue_each.cpp +++ b/eeschema/dialogs/dialog_rescue_each.cpp @@ -223,7 +223,7 @@ void DIALOG_RESCUE_EACH::PopulateInstanceList() data.clear(); data.push_back( eachSymbol->GetRef( m_currentSheet ) ); - data.push_back( valueField ? valueField->GetText() : wxT( "" ) ); + data.push_back( valueField ? valueField->GetText() : wxString() ); m_ListOfInstances->AppendItem( data ); count++; } diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 5c14326f0c..87212c9713 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -1402,7 +1402,7 @@ void SCH_EDIT_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName ) wxString tmp = recoveredFn.GetName(); // Strip "_autosave-" prefix from the auto save file name. - tmp.Replace( GetAutoSaveFilePrefix(), wxT( "" ), false ); + tmp.Replace( GetAutoSaveFilePrefix(), wxEmptyString, false ); recoveredFn.SetName( tmp ); wxFileName backupFn = recoveredFn; diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 6b282c839a..84db60acaf 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1521,7 +1521,7 @@ void SCH_EDIT_FRAME::UpdateNetHighlightStatus() } else { - SetStatusText( wxT( "" ) ); + SetStatusText( wxEmptyString ); } } diff --git a/eeschema/sch_plugins/altium/altium_parser_sch.cpp b/eeschema/sch_plugins/altium/altium_parser_sch.cpp index 4a0cd1d915..2978608cfb 100644 --- a/eeschema/sch_plugins/altium/altium_parser_sch.cpp +++ b/eeschema/sch_plugins/altium/altium_parser_sch.cpp @@ -108,9 +108,9 @@ ASCH_SYMBOL::ASCH_SYMBOL( const std::map& aProps ) wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::COMPONENT ); currentpartid = ALTIUM_PARSER::ReadInt( aProps, wxT( "CURRENTPARTID" ), ALTIUM_COMPONENT_NONE ); - libreference = ALTIUM_PARSER::ReadString( aProps, wxT( "LIBREFERENCE" ), wxT( "" ) ); - sourcelibraryname = ALTIUM_PARSER::ReadString( aProps, wxT( "SOURCELIBRARYNAME" ), wxT( "" ) ); - componentdescription = ALTIUM_PARSER::ReadString( aProps, wxT( "COMPONENTDESCRIPTION" ), wxT( "" ) ); + libreference = ALTIUM_PARSER::ReadString( aProps, wxT( "LIBREFERENCE" ), wxEmptyString ); + sourcelibraryname = ALTIUM_PARSER::ReadString( aProps, wxT( "SOURCELIBRARYNAME" ), wxEmptyString ); + componentdescription = ALTIUM_PARSER::ReadString( aProps, wxT( "COMPONENTDESCRIPTION" ), wxEmptyString ); orientation = ALTIUM_PARSER::ReadInt( aProps, wxT( "ORIENTATION" ), 0 ); isMirrored = ALTIUM_PARSER::ReadBool( aProps, wxT( "ISMIRRORED" ), false ); @@ -131,9 +131,9 @@ ASCH_PIN::ASCH_PIN( const std::map& aProps ) ownerpartid = ReadOwnerPartId( aProps ); ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, wxT( "OWNERPARTDISPLAYMODE" ), 0 ); - name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxT( "" ) ); - text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxT( "" ) ); - designator = ALTIUM_PARSER::ReadString( aProps, wxT( "DESIGNATOR" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxEmptyString ); + text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxEmptyString ); + designator = ALTIUM_PARSER::ReadString( aProps, wxT( "DESIGNATOR" ), wxEmptyString ); int symbolOuterInt = ALTIUM_PARSER::ReadInt( aProps, wxT( "SYMBOL_OUTER" ), 0 ); symbolOuter = static_cast( symbolOuterInt ); @@ -214,7 +214,7 @@ ASCH_LABEL::ASCH_LABEL( const std::map& aProps ) location = wxPoint( ReadKiCadUnitFrac( aProps, wxT( "LOCATION.X" ) ), -ReadKiCadUnitFrac( aProps, wxT( "LOCATION.Y" ) ) ); - text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxT( "" ) ); + text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxEmptyString ); fontId = ALTIUM_PARSER::ReadInt( aProps, wxT( "FONTID" ), 0 ); isMirrored = ALTIUM_PARSER::ReadBool( aProps, wxT( "ISMIRRORED" ), false ); @@ -237,7 +237,7 @@ ASCH_TEXT_FRAME::ASCH_TEXT_FRAME( const std::map& aProps ) size = wxSize( ReadKiCadUnitFrac( aProps, wxT( "CORNER.X" ) ) - location.x, -ReadKiCadUnitFrac( aProps, wxT( "CORNER.Y" ) ) - location.y ); - text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxT( "" ) ); + text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxEmptyString ); text.Replace( wxT( "~1" ), wxT( "\n" ), true ); fontId = ALTIUM_PARSER::ReadInt( aProps, wxT( "FONTID" ), 0 ); @@ -256,7 +256,7 @@ ASCH_NOTE::ASCH_NOTE( const std::map& aProperties ) : { wxASSERT( ReadRecord( aProperties ) == ALTIUM_SCH_RECORD::NOTE ); - author = ALTIUM_PARSER::ReadString( aProperties, wxT( "AUTHOR" ), wxT( "" ) ); + author = ALTIUM_PARSER::ReadString( aProperties, wxT( "AUTHOR" ), wxEmptyString ); } @@ -444,7 +444,7 @@ ASCH_SHEET_ENTRY::ASCH_SHEET_ENTRY( const std::map& aProps ) side = ReadEnum( aProps, wxT( "SIDE" ), 0, 3, ASCH_SHEET_ENTRY_SIDE::LEFT ); - name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxEmptyString ); iotype = ReadEnum( aProps, wxT( "IOTYPE" ), 0, 3, ASCH_PORT_IOTYPE::UNSPECIFIED ); style = ReadEnum( aProps, wxT( "STYLE" ), 0, 7, ASCH_PORT_STYLE::NONE_HORIZONTAL ); @@ -463,7 +463,7 @@ ASCH_POWER_PORT::ASCH_POWER_PORT( const std::map& aProps ) orientation = ReadEnum( aProps, wxT( "ORIENTATION" ), 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS ); - text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxT( "" ) ); + text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxEmptyString ); showNetName = ALTIUM_PARSER::ReadBool( aProps, wxT( "SHOWNETNAME" ), true ); style = ReadEnum( aProps, wxT( "STYLE" ), 0, 10, @@ -479,8 +479,8 @@ ASCH_PORT::ASCH_PORT( const std::map& aProps ) location = wxPoint( ReadKiCadUnitFrac( aProps, wxT( "LOCATION.X" ) ), -ReadKiCadUnitFrac( aProps, wxT( "LOCATION.Y" ) ) ); - name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxT( "" ) ); - harnessType = ALTIUM_PARSER::ReadString( aProps, wxT( "HARNESSTYPE" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxEmptyString ); + harnessType = ALTIUM_PARSER::ReadString( aProps, wxT( "HARNESSTYPE" ), wxEmptyString ); width = ReadKiCadUnitFrac( aProps, wxT( "WIDTH" ) ); height = ReadKiCadUnitFrac( aProps, wxT( "HEIGHT" ) ); @@ -506,7 +506,7 @@ ASCH_NET_LABEL::ASCH_NET_LABEL( const std::map& aProps ) { wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::NET_LABEL ); - text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxT( "" ) ); + text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxEmptyString ); location = wxPoint( ReadKiCadUnitFrac( aProps, wxT( "LOCATION.X" ) ), -ReadKiCadUnitFrac( aProps, wxT( "LOCATION.Y" ) ) ); @@ -572,7 +572,7 @@ ASCH_IMAGE::ASCH_IMAGE( const std::map& aProps ) indexinsheet = ALTIUM_PARSER::ReadInt( aProps, wxT( "INDEXINSHEET" ), 0 ); ownerpartid = ReadOwnerPartId( aProps ); - filename = ALTIUM_PARSER::ReadString( aProps, wxT( "FILENAME" ), wxT( "" ) ); + filename = ALTIUM_PARSER::ReadString( aProps, wxT( "FILENAME" ), wxEmptyString ); location = wxPoint( ReadKiCadUnitFrac( aProps, wxT( "LOCATION.X" ) ), -ReadKiCadUnitFrac( aProps, wxT( "LOCATION.Y" ) ) ); @@ -590,7 +590,7 @@ ASCH_SHEET_FONT::ASCH_SHEET_FONT( const std::map& aProps, in const wxString sid = std::to_string( aId ); - fontname = ALTIUM_PARSER::ReadString( aProps, wxT( "FONTNAME" ) + sid, wxT( "" ) ); + fontname = ALTIUM_PARSER::ReadString( aProps, wxT( "FONTNAME" ) + sid, wxEmptyString ); size = ReadKiCadUnitFrac( aProps, wxT( "SIZE" ) + sid ); rotation = ALTIUM_PARSER::ReadInt( aProps, wxT( "ROTATION" ) + sid, 0 ); @@ -650,7 +650,7 @@ ASCH_SHEET_NAME::ASCH_SHEET_NAME( const std::map& aProps ) ownerindex = ReadOwnerIndex( aProps ); ownerpartid = ReadOwnerPartId( aProps ); - text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxT( "" ) ); + text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxEmptyString ); orientation = ReadEnum( aProps, wxT( "ORIENTATION" ), 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS ); @@ -669,7 +669,7 @@ ASCH_FILE_NAME::ASCH_FILE_NAME( const std::map& aProps ) ownerindex = ReadOwnerIndex( aProps ); ownerpartid = ReadOwnerPartId( aProps ); - text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxT( "" ) ); + text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxEmptyString ); orientation = ReadEnum( aProps, wxT( "ORIENTATION" ), 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS ); @@ -688,8 +688,8 @@ ASCH_DESIGNATOR::ASCH_DESIGNATOR( const std::map& aProps ) ownerindex = ReadOwnerIndex( aProps ); ownerpartid = ReadOwnerPartId( aProps ); - name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxT( "" ) ); - text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxEmptyString ); + text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxEmptyString ); justification = ReadEnum( aProps, wxT( "JUSTIFICATION" ), 0, 8, ASCH_LABEL_JUSTIFICATION::BOTTOM_LEFT ); @@ -707,9 +707,9 @@ ASCH_IMPLEMENTATION::ASCH_IMPLEMENTATION( const std::map& aP wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::IMPLEMENTATION ); ownerindex = ALTIUM_PARSER::ReadInt( aProps, wxT( "OWNERINDEX" ), ALTIUM_COMPONENT_NONE ); - name = ALTIUM_PARSER::ReadString( aProps, wxT( "MODELNAME" ), wxT( "" ) ); - type = ALTIUM_PARSER::ReadString( aProps, wxT( "MODELTYPE" ), wxT( "" ) ); - libname = ALTIUM_PARSER::ReadString( aProps, wxT( "MODELDATAFILE0" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( aProps, wxT( "MODELNAME" ), wxEmptyString ); + type = ALTIUM_PARSER::ReadString( aProps, wxT( "MODELTYPE" ), wxEmptyString ); + libname = ALTIUM_PARSER::ReadString( aProps, wxT( "MODELDATAFILE0" ), wxEmptyString ); isCurrent = ALTIUM_PARSER::ReadBool( aProps, wxT( "ISCURRENT" ), false ); } @@ -748,8 +748,8 @@ ASCH_PARAMETER::ASCH_PARAMETER( const std::map& aProps ) orientation = ReadEnum( aProps, wxT( "ORIENTATION" ), 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS ); - name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxT( "" ) ); - text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( aProps, wxT( "NAME" ), wxEmptyString ); + text = ALTIUM_PARSER::ReadString( aProps, wxT( "TEXT" ), wxEmptyString ); isHidden = ALTIUM_PARSER::ReadBool( aProps, wxT( "ISHIDDEN" ), false ); isMirrored = ALTIUM_PARSER::ReadBool( aProps, wxT( "ISMIRRORED" ), false ); diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp index e5a323ffd6..12fe9207b2 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp @@ -293,7 +293,7 @@ void SCH_ALTIUM_PLUGIN::ParseStorage( const CFB::CompoundFileReader& aReader ) ALTIUM_PARSER reader( aReader, file ); std::map properties = reader.ReadProperties(); - wxString header = ALTIUM_PARSER::ReadString( properties, wxT( "HEADER" ), wxT( "" ) ); + wxString header = ALTIUM_PARSER::ReadString( properties, wxT( "HEADER" ), wxEmptyString ); int weight = ALTIUM_PARSER::ReadInt( properties, wxT( "WEIGHT" ), 0 ); if( weight < 0 ) @@ -567,7 +567,7 @@ void SCH_ALTIUM_PLUGIN::ParseComponent( int aIndex, // TODO: this is a hack until we correctly apply all transformations to every element wxString name = wxString::Format( wxT( "%d%s_%s" ), elem.orientation, - elem.isMirrored ? wxT( "_mirrored" ) : wxT( "" ), + elem.isMirrored ? wxT( "_mirrored" ) : wxEmptyString, elem.libreference ); LIB_ID libId = AltiumToKiCadLibID( getLibName(), name ); diff --git a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp index 7068d98478..e676aa6a49 100644 --- a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp +++ b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp @@ -1296,7 +1296,7 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode ) wxString libraryname = epart->library; wxString gatename = epart->deviceset + epart->device + einstance.gate; wxString symbolname = wxString( epart->deviceset + epart->device ); - symbolname.Replace( wxT( "*" ), wxT( "" ) ); + symbolname.Replace( wxT( "*" ), wxEmptyString ); wxString kisymbolname = EscapeString( symbolname, CTX_LIBID ); int unit = m_eagleLibs[libraryname].GateUnit[gatename]; @@ -1518,7 +1518,10 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode, // Get Device set information EDEVICE_SET edeviceset = EDEVICE_SET( devicesetNode ); - wxString prefix = edeviceset.prefix ? edeviceset.prefix.Get() : wxT( "" ); + wxString prefix; + + if( edeviceset.prefix ) + prefix = edeviceset.prefix.Get(); NODE_MAP deviceSetChildren = MapChildren( devicesetNode ); wxXmlNode* deviceNode = getChildrenNodes( deviceSetChildren, wxT( "devices" ) ); @@ -1531,7 +1534,7 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode, // Create symbol name from deviceset and device names. wxString symbolName = edeviceset.name + edevice.name; - symbolName.Replace( wxT( "*" ), wxT( "" ) ); + symbolName.Replace( wxT( "*" ), wxEmptyString ); wxASSERT( !symbolName.IsEmpty() ); symbolName = EscapeString( symbolName, CTX_LIBID ); diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 5bf9d0d86b..93c2f77d4e 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -968,7 +968,7 @@ void SYMBOL_EDIT_FRAME::SyncLibraries( bool aShowProgress, const wxString& aForc // Try to select the parent library, in case the symbol is not found if( !found && selected.IsValid() ) { - selected.SetLibItemName( wxT( "" ) ); + selected.SetLibItemName( wxEmptyString ); found = m_libMgr->GetAdapter()->FindItem( selected ); if( found ) diff --git a/eeschema/symbol_editor/symbol_library_manager.cpp b/eeschema/symbol_editor/symbol_library_manager.cpp index 5d904e838b..07a728bede 100644 --- a/eeschema/symbol_editor/symbol_library_manager.cpp +++ b/eeschema/symbol_editor/symbol_library_manager.cpp @@ -191,7 +191,7 @@ bool SYMBOL_LIBRARY_MANAGER::SaveLibrary( const wxString& aLibrary, const wxStri bool res = true; // assume all libraries are successfully saved PROPERTIES properties; - properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, wxT( "" ) ); + properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, wxEmptyString ); auto it = m_libs.find( aLibrary ); @@ -957,7 +957,7 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptrGetName() != originalSymbol->GetName() ) @@ -1049,7 +1049,7 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptrGetName() != originalSymbol->GetName() ) diff --git a/eeschema/tools/ee_inspection_tool.cpp b/eeschema/tools/ee_inspection_tool.cpp index 15cb2fd795..dabee1bee9 100644 --- a/eeschema/tools/ee_inspection_tool.cpp +++ b/eeschema/tools/ee_inspection_tool.cpp @@ -332,7 +332,7 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) wxString pinName = pin->GetName(); if( pinName.IsEmpty() || pinName == wxT( "~" ) ) - pinName = wxT( "" ); + pinName = wxEmptyString; else pinName = wxT( "'" ) + pinName + wxT( "'" ); diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 679c0178ae..8b2cb59885 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -1007,7 +1007,7 @@ static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition ) if( !conn ) { - editFrame->SetStatusText( wxT( "" ) ); + editFrame->SetStatusText( wxEmptyString ); editFrame->SendCrossProbeClearHighlight(); } else diff --git a/gerbview/dialogs/dialog_select_one_pcb_layer.cpp b/gerbview/dialogs/dialog_select_one_pcb_layer.cpp index ed7ba0d740..d06621602a 100644 --- a/gerbview/dialogs/dialog_select_one_pcb_layer.cpp +++ b/gerbview/dialogs/dialog_select_one_pcb_layer.cpp @@ -259,7 +259,7 @@ const wxString GetPCBDefaultLayerName( int aLayerId ) // Pcbnew knows some other layers, but any other layer is not suitable for export. default: // Sentinel - txt = wxT( "" ); break; + txt = wxEmptyString; break; } return wxString( txt ); diff --git a/include/widgets/mathplot.h b/include/widgets/mathplot.h index a5d2a8696c..b40592b8aa 100644 --- a/include/widgets/mathplot.h +++ b/include/widgets/mathplot.h @@ -807,7 +807,7 @@ protected: return m_tickLabels.size(); } - virtual const wxString formatLabel( double value, int nDigits ) { return wxT( "" ); } + virtual const wxString formatLabel( double value, int nDigits ) { return wxEmptyString; } virtual void formatLabels() {}; virtual double getTickPos( int n ) const diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index c568d694b1..a15a7cc797 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -429,7 +429,7 @@ bool KICAD_MANAGER_FRAME::CloseProject( bool aSave ) mgr.UnloadProject( &Prj() ); } - SetStatusText( wxT( "" ) ); + SetStatusText( wxEmptyString ); m_leftWin->EmptyTreePrj(); diff --git a/kicad/pcm/dialogs/dialog_manage_repositories.cpp b/kicad/pcm/dialogs/dialog_manage_repositories.cpp index 8327a0cef1..fabe4f1b12 100644 --- a/kicad/pcm/dialogs/dialog_manage_repositories.cpp +++ b/kicad/pcm/dialogs/dialog_manage_repositories.cpp @@ -101,7 +101,7 @@ void DIALOG_MANAGE_REPOSITORIES::OnAddButtonClicked( wxCommandEvent& event ) } else { - WX_PROGRESS_REPORTER reporter( GetParent(), wxT( "" ), 1 ); + WX_PROGRESS_REPORTER reporter( GetParent(), wxEmptyString, 1 ); if( m_pcm->FetchRepository( url, repository, &reporter ) ) { diff --git a/kicad/pcm/pcm.cpp b/kicad/pcm/pcm.cpp index 6d49cc0ccf..7be455f3f1 100644 --- a/kicad/pcm/pcm.cpp +++ b/kicad/pcm/pcm.cpp @@ -363,7 +363,7 @@ const bool PLUGIN_CONTENT_MANAGER::CacheRepository( const wxString& aRepositoryI PCM_REPOSITORY current_repo; std::unique_ptr reporter( - new WX_PROGRESS_REPORTER( m_dialog, wxT( "" ), 1 ) ); + new WX_PROGRESS_REPORTER( m_dialog, wxEmptyString, 1 ) ); if( !FetchRepository( url, current_repo, reporter.get() ) ) return false; @@ -825,7 +825,7 @@ std::unordered_map PLUGIN_CONTENT_MANAGER::GetInstalledPacka { std::unordered_map bitmaps; - wxFileName resources_dir_fn( m_3rdparty_path, wxT( "" ) ); + wxFileName resources_dir_fn( m_3rdparty_path, wxEmptyString ); resources_dir_fn.AppendDir( wxT( "resources" ) ); wxDir resources_dir( resources_dir_fn.GetPath() ); @@ -833,7 +833,7 @@ std::unordered_map PLUGIN_CONTENT_MANAGER::GetInstalledPacka return bitmaps; wxString subdir; - bool more = resources_dir.GetFirst( &subdir, wxT( "" ), wxDIR_DIRS | wxDIR_HIDDEN ); + bool more = resources_dir.GetFirst( &subdir, wxEmptyString, wxDIR_DIRS | wxDIR_HIDDEN ); while( more ) { diff --git a/kicad/project_tree_pane.cpp b/kicad/project_tree_pane.cpp index c36e60469f..519d83acb9 100644 --- a/kicad/project_tree_pane.cpp +++ b/kicad/project_tree_pane.cpp @@ -349,7 +349,7 @@ wxTreeItemId PROJECT_TREE_PANE::addItemToProjectTree( const wxString& aName, { wxString ext = GetFileExt( (TREE_FILE_TYPE) i ); - if( ext == wxT( "" ) ) + if( ext == wxEmptyString ) continue; // For gerber files, the official ext is gbr diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 82ee5462ed..4ac7558910 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -73,7 +73,7 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: // First is always the reference designator m_DefaultFPTextItems.emplace_back( wxT( "REF**" ), true, F_SilkS ); // Second is always the value - m_DefaultFPTextItems.emplace_back( wxT( "" ), true, F_Fab ); + m_DefaultFPTextItems.emplace_back( wxEmptyString, true, F_Fab ); // Any following ones are freebies m_DefaultFPTextItems.emplace_back( wxT( "${REFERENCE}" ), true, F_Fab ); diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index 0a8a79bbf7..931d4e9c93 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -543,7 +543,7 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan() change.NewRefDes, ActionMessage[change.Action], UpdateRefDes != change.Action ? _( " will be ignored" ) - : wxT( "" ) ); + : wxString() ); } ShowReport( message, RPT_SEVERITY_INFO ); diff --git a/pcbnew/dialogs/dialog_board_statistics.cpp b/pcbnew/dialogs/dialog_board_statistics.cpp index cd271284f9..09f6ac7fcd 100644 --- a/pcbnew/dialogs/dialog_board_statistics.cpp +++ b/pcbnew/dialogs/dialog_board_statistics.cpp @@ -707,7 +707,7 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent ) // We will save data about components in the table. // We have to calculate column widths std::vector widths; - std::vector labels{ wxT( "" ), _( "Front Side" ), _( "Back Side" ), _( "Total" ) }; + std::vector labels{ wxEmptyString, _( "Front Side" ), _( "Back Side" ), _( "Total" ) }; wxString tmp; widths.reserve( labels.size() ); diff --git a/pcbnew/dialogs/dialog_export_idf.cpp b/pcbnew/dialogs/dialog_export_idf.cpp index 076d8205ab..9609d5aefe 100644 --- a/pcbnew/dialogs/dialog_export_idf.cpp +++ b/pcbnew/dialogs/dialog_export_idf.cpp @@ -64,7 +64,7 @@ public: wxString tmpStr; tmpStr << m_XRef; m_IDF_Xref->SetValue( tmpStr ); - tmpStr = wxT( "" ); + tmpStr = wxEmptyString; tmpStr << m_YRef; m_IDF_Yref->SetValue( tmpStr ); diff --git a/pcbnew/dialogs/dialog_export_vrml.cpp b/pcbnew/dialogs/dialog_export_vrml.cpp index 40ddd16e2f..749f9bdc22 100644 --- a/pcbnew/dialogs/dialog_export_vrml.cpp +++ b/pcbnew/dialogs/dialog_export_vrml.cpp @@ -80,7 +80,7 @@ public: wxString tmpStr; tmpStr << m_XRef; m_VRML_Xref->SetValue( tmpStr ); - tmpStr = wxT( "" ); + tmpStr = wxEmptyString; tmpStr << m_YRef; m_VRML_Yref->SetValue( tmpStr ); m_sdbSizerOK->SetDefault(); diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp index 9902f2c95d..9281f275ed 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -206,7 +206,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); \ attr->SetReadOnly(); \ m_grid->SetAttr( aRow, aCol, attr ); \ - m_grid->SetCellValue( aRow, aCol, ( aValue ) ? wxT( "1" ) : wxT( "" ) ) + m_grid->SetCellValue( aRow, aCol, ( aValue ) ? wxT( "1" ) : wxEmptyString ) const BOARD_DESIGN_SETTINGS& bds = m_parent->GetBoard()->GetDesignSettings(); wxGridCellAttr* attr; diff --git a/pcbnew/dialogs/dialog_text_properties.cpp b/pcbnew/dialogs/dialog_text_properties.cpp index 6aa22eb858..d2bac4d483 100644 --- a/pcbnew/dialogs/dialog_text_properties.cpp +++ b/pcbnew/dialogs/dialog_text_properties.cpp @@ -320,7 +320,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow() #elif defined( __WINDOWS__ ) // On Windows, a new line is coded as \r\n. We use only \n in kicad files and in // drawing routines so strip the \r char. - txt.Replace( wxT( "\r" ), wxT( "" ) ); + txt.Replace( wxT( "\r" ), wxEmptyString ); #endif m_edaText->SetText( EscapeString( txt, CTX_QUOTED_STR ) ); } diff --git a/pcbnew/dialogs/panel_fp_editor_defaults.cpp b/pcbnew/dialogs/panel_fp_editor_defaults.cpp index e782e917c4..47ca43ab16 100644 --- a/pcbnew/dialogs/panel_fp_editor_defaults.cpp +++ b/pcbnew/dialogs/panel_fp_editor_defaults.cpp @@ -115,7 +115,7 @@ public: bool AppendRows( size_t aNumRows = 1 ) override { for( size_t i = 0; i < aNumRows; ++i ) - m_items.emplace_back( wxT( "" ), true, F_SilkS ); + m_items.emplace_back( wxEmptyString, true, F_SilkS ); if( GetView() ) { @@ -241,7 +241,7 @@ bool PANEL_FP_EDITOR_DEFAULTS::TransferDataToWindow() SET_MILS_CELL( i, COL_TEXT_WIDTH, m_brdSettings.m_TextSize[ i ].x ); SET_MILS_CELL( i, COL_TEXT_HEIGHT, m_brdSettings.m_TextSize[ i ].y ); SET_MILS_CELL( i, COL_TEXT_THICKNESS, m_brdSettings.m_TextThickness[ i ] ); - m_graphicsGrid->SetCellValue( i, COL_TEXT_ITALIC, m_brdSettings.m_TextItalic[ i ] ? wxT( "1" ) : wxT( "" ) ); + m_graphicsGrid->SetCellValue( i, COL_TEXT_ITALIC, m_brdSettings.m_TextItalic[ i ] ? wxT( "1" ) : wxEmptyString ); auto attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index 038dce3d74..cd79d62e8a 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/pcbnew/dialogs/panel_fp_lib_table.cpp @@ -107,25 +107,25 @@ static const std::map& fileTypes() { { ID_PANEL_FPLIB_ADD_KICADMOD, { - wxT( "KiCad (folder with .kicad_mod files)" ), wxT( "" ), + wxT( "KiCad (folder with .kicad_mod files)" ), wxEmptyString, KiCadFootprintFileExtension, false, IO_MGR::KICAD_SEXP } }, { ID_PANEL_FPLIB_ADD_EAGLE6, { - wxT( "Eagle 6.x (*.lbr)" ), EagleFootprintLibPathWildcard(), wxT( "" ), + wxT( "Eagle 6.x (*.lbr)" ), EagleFootprintLibPathWildcard(), wxEmptyString, true, IO_MGR::EAGLE } }, { ID_PANEL_FPLIB_ADD_KICADLEGACY, { - wxT( "KiCad legacy (*.mod)" ), LegacyFootprintLibPathWildcard(), wxT( "" ), + wxT( "KiCad legacy (*.mod)" ), LegacyFootprintLibPathWildcard(), wxEmptyString, true, IO_MGR::LEGACY } }, { ID_PANEL_FPLIB_ADD_GEDA, { - wxT( "Geda (folder with *.fp files)" ), wxT( "" ), + wxT( "Geda (folder with *.fp files)" ), wxEmptyString, GedaPcbFootprintLibFileExtension, false, IO_MGR::GEDA_PCB } }, diff --git a/pcbnew/dialogs/panel_fp_properties_3d_model.cpp b/pcbnew/dialogs/panel_fp_properties_3d_model.cpp index e6c7ee1c94..12177e73a0 100644 --- a/pcbnew/dialogs/panel_fp_properties_3d_model.cpp +++ b/pcbnew/dialogs/panel_fp_properties_3d_model.cpp @@ -216,9 +216,9 @@ void PANEL_FP_PROPERTIES_3D_MODEL::On3DModelCellChanged( wxGridEvent& aEvent ) // Perform cleanup and validation on the filename if it isn't empty if( !filename.empty() ) { - filename.Replace( wxT( "\n" ), wxT( "" ) ); - filename.Replace( wxT( "\r" ), wxT( "" ) ); - filename.Replace( wxT( "\t" ), wxT( "" ) ); + filename.Replace( wxT( "\n" ), wxEmptyString ); + filename.Replace( wxT( "\r" ), wxEmptyString ); + filename.Replace( wxT( "\t" ), wxEmptyString ); res->ValidateFileName( filename, hasAlias ); diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp index d239c46293..e6df5d8ce5 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp @@ -148,8 +148,8 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow() SET_MILS_CELL( i, COL_TEXT_WIDTH, m_BrdSettings->m_TextSize[ i ].x ); SET_MILS_CELL( i, COL_TEXT_HEIGHT, m_BrdSettings->m_TextSize[ i ].y ); SET_MILS_CELL( i, COL_TEXT_THICKNESS, m_BrdSettings->m_TextThickness[ i ] ); - m_grid->SetCellValue( i, COL_TEXT_ITALIC, m_BrdSettings->m_TextItalic[ i ] ? wxT( "1" ) : wxT( "" ) ); - m_grid->SetCellValue( i, COL_TEXT_UPRIGHT, m_BrdSettings->m_TextUpright[ i ] ? wxT( "1" ) : wxT( "" ) ); + m_grid->SetCellValue( i, COL_TEXT_ITALIC, m_BrdSettings->m_TextItalic[ i ] ? wxT( "1" ) : wxEmptyString ); + m_grid->SetCellValue( i, COL_TEXT_UPRIGHT, m_BrdSettings->m_TextUpright[ i ] ? wxT( "1" ) : wxEmptyString ); auto attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index 8f5e4dd7d7..f64f654108 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -792,7 +792,7 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream auto sM = aFootprint->Models().begin(); auto eM = aFootprint->Models().end(); - wxFileName subdir( m_Subdir3DFpModels, wxT( "" ) ); + wxFileName subdir( m_Subdir3DFpModels, wxEmptyString ); while( sM != eM ) { @@ -926,8 +926,8 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream if( m_UseRelPathIn3DModelFilename ) { wxFileName tmp = dstFile; - tmp.SetExt( wxT( "" ) ); - tmp.SetName( wxT( "" ) ); + tmp.SetExt( wxEmptyString ); + tmp.SetName( wxEmptyString ); tmp.RemoveLastDir(); dstFile.MakeRelativeTo( tmp.GetPath() ); } @@ -1049,7 +1049,7 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt void EXPORTER_PCB_VRML::ExportFp3DModelsAsLinkedFile( const wxString& aFullFileName ) { // check if the 3D Subdir exists - create if not - wxFileName subdir( m_Subdir3DFpModels, wxT( "" ) ); + wxFileName subdir( m_Subdir3DFpModels, wxEmptyString ); if( ! subdir.DirExists() ) { diff --git a/pcbnew/footprint_edit_frame.h b/pcbnew/footprint_edit_frame.h index 79eaf92840..3b27524bd9 100644 --- a/pcbnew/footprint_edit_frame.h +++ b/pcbnew/footprint_edit_frame.h @@ -220,7 +220,7 @@ public: * The import function can also read gpcb footprint file, in Newlib format. * (One footprint per file, Newlib files have no special ext.) */ - FOOTPRINT* ImportFootprint( const wxString& aName = wxT( "" ) ); + FOOTPRINT* ImportFootprint( const wxString& aName = wxEmptyString ); /** * Load a footprint from the main board into the Footprint Editor. diff --git a/pcbnew/footprint_editor_settings.cpp b/pcbnew/footprint_editor_settings.cpp index 0895bde003..a90a54792a 100644 --- a/pcbnew/footprint_editor_settings.cpp +++ b/pcbnew/footprint_editor_settings.cpp @@ -128,7 +128,7 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() : if( entry.empty() || !entry.is_array() ) continue; - TEXT_ITEM_INFO textInfo( wxT( "" ), true, F_SilkS ); + TEXT_ITEM_INFO textInfo( wxEmptyString, true, F_SilkS ); textInfo.m_Text = entry.at(0).get(); textInfo.m_Visible = entry.at(1).get(); diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 46d386f124..fcd94604aa 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -440,7 +440,7 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateParameterList() m_parameterGrid->SetCellEditor( i, WIZ_COL_VALUE, new wxGridCellChoiceEditor( options ) ); - units = wxT( "" ); + units = wxEmptyString; } else if( units == WIZARD_PARAM_UNITS_INTEGER ) // Integer parameters { diff --git a/pcbnew/netlist_reader/board_netlist_updater.cpp b/pcbnew/netlist_reader/board_netlist_updater.cpp index 05ab2af89a..d3550d9f7a 100644 --- a/pcbnew/netlist_reader/board_netlist_updater.cpp +++ b/pcbnew/netlist_reader/board_netlist_updater.cpp @@ -1027,8 +1027,8 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist ) } // Update the ratsnest - m_reporter->ReportTail( wxT( "" ), RPT_SEVERITY_ACTION ); - m_reporter->ReportTail( wxT( "" ), RPT_SEVERITY_ACTION ); + m_reporter->ReportTail( wxEmptyString, RPT_SEVERITY_ACTION ); + m_reporter->ReportTail( wxEmptyString, RPT_SEVERITY_ACTION ); msg.Printf( _( "Total warnings: %d, errors: %d." ), m_warningCount, m_errorCount ); m_reporter->ReportTail( msg, RPT_SEVERITY_INFO ); diff --git a/pcbnew/plugins/altium/altium_parser_pcb.cpp b/pcbnew/plugins/altium/altium_parser_pcb.cpp index e49676a6c1..b525481520 100644 --- a/pcbnew/plugins/altium/altium_parser_pcb.cpp +++ b/pcbnew/plugins/altium/altium_parser_pcb.cpp @@ -192,7 +192,7 @@ ABOARD6::ABOARD6( ALTIUM_PARSER& aReader ) ABOARD6_LAYER_STACKUP l; - l.name = ALTIUM_PARSER::ReadString( props, layername, wxT( "" ) ); + l.name = ALTIUM_PARSER::ReadString( props, layername, wxEmptyString ); l.nextId = ALTIUM_PARSER::ReadInt( props, layeri + wxT( "NEXT" ), 0 ); l.prevId = ALTIUM_PARSER::ReadInt( props, layeri + wxT( "PREV" ), 0 ); l.copperthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + wxT( "COPTHICK" ), wxT( "1.4mil" ) ); @@ -217,8 +217,8 @@ ACLASS6::ACLASS6( ALTIUM_PARSER& aReader ) if( properties.empty() ) THROW_IO_ERROR( wxT( "Classes6 stream has no properties!" ) ); - name = ALTIUM_PARSER::ReadString( properties, wxT( "NAME" ), wxT( "" ) ); - uniqueid = ALTIUM_PARSER::ReadString( properties, wxT( "UNIQUEID" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( properties, wxT( "NAME" ), wxEmptyString ); + uniqueid = ALTIUM_PARSER::ReadString( properties, wxT( "UNIQUEID" ), wxEmptyString ); kind = static_cast( ALTIUM_PARSER::ReadInt( properties, wxT( "KIND" ), -1 ) ); for( size_t i = 0; i < std::numeric_limits::max(); i++ ) @@ -242,19 +242,19 @@ ACOMPONENT6::ACOMPONENT6( ALTIUM_PARSER& aReader ) if( props.empty() ) THROW_IO_ERROR( wxT( "Components6 stream has no props" ) ); - layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, wxT( "LAYER" ), wxT( "" ) ) ); + layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, wxT( "LAYER" ), wxEmptyString ) ); position = wxPoint( ALTIUM_PARSER::ReadKicadUnit( props, wxT( "X" ), wxT( "0mil" ) ), -ALTIUM_PARSER::ReadKicadUnit( props, wxT( "Y" ), wxT( "0mil" ) ) ); rotation = ALTIUM_PARSER::ReadDouble( props, wxT( "ROTATION" ), 0. ); locked = ALTIUM_PARSER::ReadBool( props, wxT( "LOCKED" ), false ); nameon = ALTIUM_PARSER::ReadBool( props, wxT( "NAMEON" ), true ); commenton = ALTIUM_PARSER::ReadBool( props, wxT( "COMMENTON" ), false ); - sourcedesignator = ALTIUM_PARSER::ReadString( props, wxT( "SOURCEDESIGNATOR" ), wxT( "" ) ); - sourcefootprintlibrary = ALTIUM_PARSER::ReadString( props, wxT( "SOURCEFOOTPRINTLIBRARY" ), wxT( "" ) ); - pattern = ALTIUM_PARSER::ReadString( props, wxT( "PATTERN" ), wxT( "" ) ); + sourcedesignator = ALTIUM_PARSER::ReadString( props, wxT( "SOURCEDESIGNATOR" ), wxEmptyString ); + sourcefootprintlibrary = ALTIUM_PARSER::ReadString( props, wxT( "SOURCEFOOTPRINTLIBRARY" ), wxEmptyString ); + pattern = ALTIUM_PARSER::ReadString( props, wxT( "PATTERN" ), wxEmptyString ); - sourcecomponentlibrary = ALTIUM_PARSER::ReadString( props, wxT( "SOURCECOMPONENTLIBRARY" ), wxT( "" ) ); - sourcelibreference = ALTIUM_PARSER::ReadString( props, wxT( "SOURCELIBREFERENCE" ), wxT( "" ) ); + sourcecomponentlibrary = ALTIUM_PARSER::ReadString( props, wxT( "SOURCECOMPONENTLIBRARY" ), wxEmptyString ); + sourcelibreference = ALTIUM_PARSER::ReadString( props, wxT( "SOURCELIBREFERENCE" ), wxEmptyString ); nameautoposition = static_cast( ALTIUM_PARSER::ReadInt( props, wxT( "NAMEAUTOPOSITION" ), 0 ) ); @@ -274,12 +274,12 @@ ADIMENSION6::ADIMENSION6( ALTIUM_PARSER& aReader ) if( props.empty() ) THROW_IO_ERROR( wxT( "Dimensions6 stream has no props" ) ); - layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, wxT( "LAYER" ), wxT( "" ) ) ); + layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, wxT( "LAYER" ), wxEmptyString ) ); kind = static_cast( ALTIUM_PARSER::ReadInt( props, wxT( "DIMENSIONKIND" ), 0 ) ); - textformat = ALTIUM_PARSER::ReadString( props, wxT( "TEXTFORMAT" ), wxT( "" ) ); - textprefix = ALTIUM_PARSER::ReadString( props, wxT( "TEXTPREFIX" ), wxT( "" ) ); - textsuffix = ALTIUM_PARSER::ReadString( props, wxT( "TEXTSUFFIX" ), wxT( "" ) ); + textformat = ALTIUM_PARSER::ReadString( props, wxT( "TEXTFORMAT" ), wxEmptyString ); + textprefix = ALTIUM_PARSER::ReadString( props, wxT( "TEXTPREFIX" ), wxEmptyString ); + textsuffix = ALTIUM_PARSER::ReadString( props, wxT( "TEXTSUFFIX" ), wxEmptyString ); height = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "HEIGHT" ), wxT( "0mil" ) ); angle = ALTIUM_PARSER::ReadDouble( props, wxT( "ANGLE" ), 0. ); @@ -294,7 +294,7 @@ ADIMENSION6::ADIMENSION6( ALTIUM_PARSER& aReader ) arrowsize = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "ARROWSIZE" ), wxT( "60mil" ) ); - wxString text_position_raw = ALTIUM_PARSER::ReadString( props, wxT( "TEXTPOSITION" ), wxT( "" ) ); + wxString text_position_raw = ALTIUM_PARSER::ReadString( props, wxT( "TEXTPOSITION" ), wxEmptyString ); xy1 = wxPoint( ALTIUM_PARSER::ReadKicadUnit( props, wxT( "X1" ), wxT( "0mil" ) ), -ALTIUM_PARSER::ReadKicadUnit( props, wxT( "Y1" ), wxT( "0mil" ) ) ); @@ -340,8 +340,8 @@ AMODEL::AMODEL( ALTIUM_PARSER& aReader ) if( properties.empty() ) THROW_IO_ERROR( wxT( "Classes6 stream has no properties!" ) ); - name = ALTIUM_PARSER::ReadString( properties, wxT( "NAME" ), wxT( "" ) ); - id = ALTIUM_PARSER::ReadString( properties, wxT( "ID" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( properties, wxT( "NAME" ), wxEmptyString ); + id = ALTIUM_PARSER::ReadString( properties, wxT( "ID" ), wxEmptyString ); isEmbedded = ALTIUM_PARSER::ReadBool( properties, wxT( "EMBED" ), false ); rotation.x = ALTIUM_PARSER::ReadDouble( properties, wxT( "ROTX" ), 0. ); @@ -359,7 +359,7 @@ ANET6::ANET6( ALTIUM_PARSER& aReader ) if( properties.empty() ) THROW_IO_ERROR( wxT( "Nets6 stream has no properties" ) ); - name = ALTIUM_PARSER::ReadString( properties, wxT( "NAME" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( properties, wxT( "NAME" ), wxEmptyString ); if( aReader.HasParsingError() ) THROW_IO_ERROR( wxT( "Nets6 stream was not parsed correctly" ) ); @@ -372,7 +372,7 @@ APOLYGON6::APOLYGON6( ALTIUM_PARSER& aReader ) if( properties.empty() ) THROW_IO_ERROR( wxT( "Polygons6 stream has no properties" ) ); - layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( properties, wxT( "LAYER" ), wxT( "" ) ) ); + layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( properties, wxT( "LAYER" ), wxEmptyString ) ); net = ALTIUM_PARSER::ReadInt( properties, wxT( "NET" ), ALTIUM_NET_UNCONNECTED ); locked = ALTIUM_PARSER::ReadBool( properties, wxT( "LOCKED" ), false ); @@ -385,7 +385,7 @@ APOLYGON6::APOLYGON6( ALTIUM_PARSER& aReader ) pourindex = ALTIUM_PARSER::ReadInt( properties, wxT( "POURINDEX" ), 0 ); - wxString hatchstyleraw = ALTIUM_PARSER::ReadString( properties, wxT( "HATCHSTYLE" ), wxT( "" ) ); + wxString hatchstyleraw = ALTIUM_PARSER::ReadString( properties, wxT( "HATCHSTYLE" ), wxEmptyString ); if( hatchstyleraw == wxT( "Solid" ) ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::SOLID; else if( hatchstyleraw == wxT( "45Degree" ) ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::DEGREE_45; @@ -418,13 +418,13 @@ ARULE6::ARULE6( ALTIUM_PARSER& aReader ) if( props.empty() ) THROW_IO_ERROR( wxT( "Rules6 stream has no props" ) ); - name = ALTIUM_PARSER::ReadString( props, wxT( "NAME" ), wxT( "" ) ); + name = ALTIUM_PARSER::ReadString( props, wxT( "NAME" ), wxEmptyString ); priority = ALTIUM_PARSER::ReadInt( props, wxT( "PRIORITY" ), 1 ); - scope1expr = ALTIUM_PARSER::ReadString( props, wxT( "SCOPE1EXPRESSION" ), wxT( "" ) ); - scope2expr = ALTIUM_PARSER::ReadString( props, wxT( "SCOPE2EXPRESSION" ), wxT( "" ) ); + scope1expr = ALTIUM_PARSER::ReadString( props, wxT( "SCOPE1EXPRESSION" ), wxEmptyString ); + scope2expr = ALTIUM_PARSER::ReadString( props, wxT( "SCOPE2EXPRESSION" ), wxEmptyString ); - wxString rulekind = ALTIUM_PARSER::ReadString( props, wxT( "RULEKIND" ), wxT( "" ) ); + wxString rulekind = ALTIUM_PARSER::ReadString( props, wxT( "RULEKIND" ), wxEmptyString ); if( rulekind == wxT( "Clearance" ) ) { kind = ALTIUM_RULE_KIND::CLEARANCE; @@ -466,7 +466,7 @@ ARULE6::ARULE6( ALTIUM_PARSER& aReader ) polygonconnectReliefconductorwidth = ALTIUM_PARSER::ReadKicadUnit( props, wxT( "RELIEFCONDUCTORWIDTH" ), wxT( "10mil" ) ); polygonconnectReliefentries = ALTIUM_PARSER::ReadInt( props, wxT( "RELIEFENTRIES" ), 4 ); - wxString style = ALTIUM_PARSER::ReadString( props, wxT( "CONNECTSTYLE" ), wxT( "" ) ); + wxString style = ALTIUM_PARSER::ReadString( props, wxT( "CONNECTSTYLE" ), wxEmptyString ); if( style == wxT( "Direct" ) ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::DIRECT; else if( style == wxT( "Relief" ) ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::RELIEF; @@ -538,8 +538,8 @@ ACOMPONENTBODY6::ACOMPONENTBODY6( ALTIUM_PARSER& aReader ) if( properties.empty() ) THROW_IO_ERROR( wxT( "ComponentsBodies6 stream has no properties" ) ); - modelName = ALTIUM_PARSER::ReadString( properties, wxT( "MODEL.NAME" ), wxT( "" ) ); - modelId = ALTIUM_PARSER::ReadString( properties, wxT( "MODELID" ), wxT( "" ) ); + modelName = ALTIUM_PARSER::ReadString( properties, wxT( "MODEL.NAME" ), wxEmptyString ); + modelId = ALTIUM_PARSER::ReadString( properties, wxT( "MODELID" ), wxEmptyString ); modelIsEmbedded = ALTIUM_PARSER::ReadBool( properties, wxT( "MODEL.EMBED" ), false ); modelPosition.x = ALTIUM_PARSER::ReadKicadUnit( properties, wxT( "MODEL.2D.X" ), wxT( "0mil" ) ); diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index ea99f7baca..31e59816de 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -714,7 +714,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponentLibrary() SYMDEF_PCB component = symPair.second; wxString fpName = component.ReferenceName + ( ( component.Alternate.size() > 0 ) ? ( wxT( " (" ) + component.Alternate + wxT( ")" ) ) : - wxT( "" ) ); + wxString() ); // Check that we are not loading a documentation symbol. // Documentation symbols in CADSTAR are graphical "footprints" that can be assigned @@ -999,7 +999,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad, // PCB Only pads in CADSTAR do not have a representation in the schematic - they are // purely mechanical pads that have no net associated with them. Make the pad name // empty to avoid warnings when importing from the schematic - pad->SetNumber( wxT( "" ) ); + pad->SetNumber( wxEmptyString ); } else { diff --git a/pcbnew/plugins/pcad/pcb.cpp b/pcbnew/plugins/pcad/pcb.cpp index a03da78613..3c5229425b 100644 --- a/pcbnew/plugins/pcad/pcb.cpp +++ b/pcbnew/plugins/pcad/pcb.cpp @@ -86,7 +86,7 @@ PCB::PCB( BOARD* aBoard ) : TLAYER layer; layer.KiCadLayer = F_Mask; // default layer.layerType = LAYER_TYPE_NONSIGNAL; // default - layer.netNameRef = wxT( "" ); // default + layer.netNameRef = wxEmptyString; // default m_LayersMap.insert( std::make_pair( i, layer ) ); } diff --git a/pcbnew/plugins/pcad/pcb_text.cpp b/pcbnew/plugins/pcad/pcb_text.cpp index fdf4235cc9..da99ba4b5f 100644 --- a/pcbnew/plugins/pcad/pcb_text.cpp +++ b/pcbnew/plugins/pcad/pcb_text.cpp @@ -75,7 +75,7 @@ void PCB_TEXT::Parse( XNODE* aNode, int aLayer, const wxString& aDefaultUnits, } aNode->GetAttribute( wxT( "Name" ), &m_name.text ); - m_name.text.Replace( wxT( "\r" ), wxT( "" ) ); + m_name.text.Replace( wxT( "\r" ), wxEmptyString ); str = FindNodeGetContent( aNode, wxT( "justify" ) ); m_name.justify = GetJustifyIdentificator( str ); diff --git a/qa/common/libeval/test_numeric_evaluator.cpp b/qa/common/libeval/test_numeric_evaluator.cpp index 1a9b750ea2..7242f4b59c 100644 --- a/qa/common/libeval/test_numeric_evaluator.cpp +++ b/qa/common/libeval/test_numeric_evaluator.cpp @@ -110,7 +110,7 @@ BOOST_AUTO_TEST_CASE( SetVar ) */ static const std::vector eval_cases_valid = { // Empty case - { wxT( "" ), wxT( "0" ) }, + { wxEmptyString, wxT( "0" ) }, // Trivial eval { wxT( "1" ), wxT( "1" ) }, // Decimal separators diff --git a/qa/pns/pns_log_viewer.cpp b/qa/pns/pns_log_viewer.cpp index bc8ed73282..ea9478d77f 100644 --- a/qa/pns/pns_log_viewer.cpp +++ b/qa/pns/pns_log_viewer.cpp @@ -293,11 +293,11 @@ PNS_LOG_VIEWER_FRAME::PNS_LOG_VIEWER_FRAME( wxFrame* frame ) : PNS_LOG_VIEWER_FR settings->SetZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_FILLED ); - m_listPopupMenu = new wxMenu( wxT( "" ) ); - m_listPopupMenu->Append( ID_LIST_COPY, wxT( "Copy selected geometry" ), wxT( "" ), + m_listPopupMenu = new wxMenu( wxEmptyString ); + m_listPopupMenu->Append( ID_LIST_COPY, wxT( "Copy selected geometry" ), wxEmptyString, wxITEM_NORMAL ); - m_listPopupMenu->Append( ID_LIST_SHOW_ALL, wxT( "Show all" ), wxT( "" ), wxITEM_NORMAL ); - m_listPopupMenu->Append( ID_LIST_SHOW_NONE, wxT( "Show none" ), wxT( "" ), wxITEM_NORMAL ); + m_listPopupMenu->Append( ID_LIST_SHOW_ALL, wxT( "Show all" ), wxEmptyString, wxITEM_NORMAL ); + m_listPopupMenu->Append( ID_LIST_SHOW_NONE, wxT( "Show none" ), wxEmptyString, wxITEM_NORMAL ); m_itemList->Connect( m_itemList->GetId(), wxEVT_TREELIST_ITEM_CONTEXT_MENU, wxMouseEventHandler( PNS_LOG_VIEWER_FRAME::onListRightClick ), nullptr, diff --git a/utils/kicad2step/pcb/3d_resolver.cpp b/utils/kicad2step/pcb/3d_resolver.cpp index a9c01e9af2..ba43db1e2e 100644 --- a/utils/kicad2step/pcb/3d_resolver.cpp +++ b/utils/kicad2step/pcb/3d_resolver.cpp @@ -187,7 +187,7 @@ wxString S3D_RESOLVER::ResolvePath( const wxString& aFileName, // users can potentially override a model within ${KICAD6_3DMODEL_DIR}. if( !m_Paths.empty() && !m_Paths.begin()->m_Pathexp.empty() && !tname.StartsWith( wxT( ":" ) ) ) { - tmpFN.Assign( m_Paths.begin()->m_Pathexp, wxT( "" ) ); + tmpFN.Assign( m_Paths.begin()->m_Pathexp, wxEmptyString ); wxString fullPath = tmpFN.GetPathWithSep() + tname; if( fullPath.StartsWith( wxT( "${" ) ) || fullPath.StartsWith( wxT( "$(" ) ) ) @@ -295,7 +295,7 @@ bool S3D_RESOLVER::addPath( const SEARCH_PATH& aPath ) tpath.m_Pathvar.erase( tpath.m_Pathvar.length() - 1 ); #endif - wxFileName path( tpath.m_Pathvar, wxT( "" ) ); + wxFileName path( tpath.m_Pathvar, wxEmptyString ); path.Normalize(); if( !path.DirExists() ) @@ -485,7 +485,7 @@ void S3D_RESOLVER::checkEnvVarPath( const wxString& aPath ) SEARCH_PATH lpath; lpath.m_Alias = envar; lpath.m_Pathvar = lpath.m_Alias; - wxFileName tmpFN( lpath.m_Alias, wxT( "" ) ); + wxFileName tmpFN( lpath.m_Alias, wxEmptyString ); wxUniChar psep = tmpFN.GetPathSeparator(); tmpFN.Normalize(); @@ -560,7 +560,7 @@ wxString S3D_RESOLVER::ShortenPath( const wxString& aFullPathName ) continue; } - wxFileName fpath( sL->m_Pathexp, wxT( "" ) ); + wxFileName fpath( sL->m_Pathexp, wxEmptyString ); wxString fps = fpath.GetPathWithSep(); wxString tname; diff --git a/utils/kicad2step/pcb/kicadpcb.cpp b/utils/kicad2step/pcb/kicadpcb.cpp index c438a0cc36..985addcae2 100644 --- a/utils/kicad2step/pcb/kicadpcb.cpp +++ b/utils/kicad2step/pcb/kicadpcb.cpp @@ -42,7 +42,7 @@ KICADPCB::KICADPCB( const wxString& aPcbName ) { - m_resolver.Set3DConfigDir( wxT( "" ) ); + m_resolver.Set3DConfigDir( wxEmptyString ); m_thickness = 1.6; m_pcb_model = nullptr; m_minDistance = MIN_DISTANCE;