From d2c0f5fc2abbb8672c7eca566ee1dc75ce15d65d Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Mon, 16 Jan 2023 23:14:38 -0500 Subject: [PATCH] More wxSing --- common/trace_helpers.cpp | 10 +-- common/utf8.cpp | 8 +-- common/validators.cpp | 4 +- common/view/view.cpp | 4 +- common/widgets/bitmap_button.cpp | 4 +- common/widgets/color_swatch.cpp | 2 +- common/widgets/footprint_choice.cpp | 6 +- common/widgets/footprint_select_widget.cpp | 4 +- common/widgets/number_badge.cpp | 4 +- common/widgets/properties_panel.cpp | 4 +- common/widgets/split_button.cpp | 6 +- common/widgets/std_bitmap_button.cpp | 8 +-- common/widgets/ui_common.cpp | 4 +- common/widgets/widget_hotkey_list.cpp | 10 +-- common/widgets/wx_grid.cpp | 6 +- common/widgets/wx_html_report_panel.cpp | 26 ++++---- common/wildcards_and_files_ext.cpp | 10 +-- cvpcb/cvpcb_mainframe.cpp | 2 +- cvpcb/display_footprints_frame.cpp | 8 +-- cvpcb/footprints_listbox.cpp | 4 +- cvpcb/library_listbox.cpp | 2 +- cvpcb/listbox_base.cpp | 2 +- cvpcb/menubar.cpp | 2 +- cvpcb/symbols_listbox.cpp | 8 +-- eeschema/autoplace_fields.cpp | 10 +-- eeschema/bom_plugins.cpp | 12 ++-- eeschema/connection_graph.cpp | 62 +++++++++---------- eeschema/cross-probing.cpp | 10 +-- eeschema/dialogs/dialog_bom.cpp | 2 +- eeschema/dialogs/dialog_change_symbols.cpp | 4 +- eeschema/dialogs/dialog_erc.cpp | 2 +- eeschema/dialogs/dialog_export_netlist.cpp | 2 +- eeschema/dialogs/dialog_field_properties.cpp | 4 +- eeschema/dialogs/dialog_label_properties.cpp | 2 +- .../dialogs/dialog_lib_edit_pin_table.cpp | 4 +- .../dialogs/dialog_lib_textbox_properties.cpp | 4 +- eeschema/dialogs/dialog_sim_model.cpp | 2 +- .../dialogs/dialog_symbol_fields_table.cpp | 12 ++-- eeschema/dialogs/dialog_symbol_properties.cpp | 4 +- eeschema/dialogs/dialog_symbol_remap.cpp | 6 +- eeschema/dialogs/panel_setup_pinmap.cpp | 2 +- eeschema/dialogs/panel_sym_lib_table.cpp | 2 +- .../dialogs/panel_template_fieldnames.cpp | 8 +-- eeschema/eeschema.cpp | 34 +++++----- eeschema/eeschema_settings.cpp | 2 +- eeschema/erc.cpp | 8 +-- eeschema/erc_item.cpp | 2 +- eeschema/erc_settings.cpp | 2 +- eeschema/fields_grid_table.cpp | 6 +- eeschema/files-io.cpp | 4 +- eeschema/generate_alias_info.cpp | 42 ++++++------- eeschema/lib_field.cpp | 2 +- eeschema/lib_symbol.cpp | 2 +- eeschema/libarch.cpp | 4 +- eeschema/pin_numbers.cpp | 8 +-- eeschema/project_rescue.cpp | 12 ++-- eeschema/sch_base_frame.cpp | 8 +-- eeschema/sch_bus_entry.cpp | 2 +- eeschema/sch_connection.cpp | 2 +- eeschema/sch_edit_frame.cpp | 18 +++--- eeschema/sch_junction.cpp | 4 +- eeschema/sch_label.cpp | 2 +- eeschema/schematic.cpp | 12 ++-- 63 files changed, 240 insertions(+), 238 deletions(-) diff --git a/common/trace_helpers.cpp b/common/trace_helpers.cpp index 8c6da2a6c0..03801a5eca 100644 --- a/common/trace_helpers.cpp +++ b/common/trace_helpers.cpp @@ -234,16 +234,16 @@ wxString GetKeyName( const wxKeyEvent &aEvent ) wxString dump( const wxKeyEvent& aEvent ) { wxString msg; - wxString eventType = "unknown"; + wxString eventType = wxS( "unknown" ); if( aEvent.GetEventType() == wxEVT_KEY_DOWN ) - eventType = "KeyDown"; + eventType = wxS( "KeyDown" ); else if( aEvent.GetEventType() == wxEVT_KEY_UP ) - eventType = "KeyUp"; + eventType = wxS( "KeyUp" ); else if( aEvent.GetEventType() == wxEVT_CHAR ) - eventType = "Char"; + eventType = wxS( "Char" ); else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK ) - eventType = "Hook"; + eventType = wxS( "Hook" ); // event key_name KeyCode modifiers Unicode raw_code raw_flags pos msg.Printf( "%7s %15s %5d %c%c%c%c" diff --git a/common/utf8.cpp b/common/utf8.cpp index a0abe222ec..144530afe8 100644 --- a/common/utf8.cpp +++ b/common/utf8.cpp @@ -108,7 +108,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult ) default: case 0: if( aResult ) - wxFAIL_MSG( "uni_forward: invalid start byte" ); + wxFAIL_MSG( wxS( "uni_forward: invalid start byte" ) ); return 0; break; @@ -117,7 +117,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult ) if( ( s[1] & 0xc0 ) != 0x80 ) { if( aResult ) - wxFAIL_MSG( "uni_forward: invalid continuation byte" ); + wxFAIL_MSG( wxS( "uni_forward: invalid continuation byte" ) ); return 0; } @@ -136,7 +136,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult ) ) { if( aResult ) - wxFAIL_MSG( "uni_forward: invalid continuation byte" ); + wxFAIL_MSG( wxS( "uni_forward: invalid continuation byte" ) ); return 0; } @@ -156,7 +156,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult ) (s[0] == 0xF4 && s[1] > 0x8F) ) { if( aResult ) - wxFAIL_MSG( "uni_forward: invalid continuation byte" ); + wxFAIL_MSG( wxS( "uni_forward: invalid continuation byte" ) ); return 0; } diff --git a/common/validators.cpp b/common/validators.cpp index 5f6d229bb7..4cfa9d6d62 100644 --- a/common/validators.cpp +++ b/common/validators.cpp @@ -74,7 +74,7 @@ FOOTPRINT_NAME_VALIDATOR::FOOTPRINT_NAME_VALIDATOR( wxString* aValue ) : // This list of characters follows the string from footprint.cpp which, in turn mimics the // strings from lib_id.cpp // TODO: Unify forbidden character lists - wxString illegalChars = "%$<>\t\n\r\"\\/:"; + wxString illegalChars = wxS( "%$<>\t\n\r\"\\/:" ); SetCharExcludes( illegalChars ); } @@ -377,7 +377,7 @@ void KIUI::ValidatorTransferToWindowWithoutEvents( wxValidator& aValidator ) { wxWindow* ctrl = aValidator.GetWindow(); - wxCHECK_RET( ctrl != nullptr, "Transferring validator data without a control" ); + wxCHECK_RET( ctrl != nullptr, wxS( "Transferring validator data without a control" ) ); wxEventBlocker orient_update_blocker( ctrl, wxEVT_ANY ); aValidator.TransferToWindow(); diff --git a/common/view/view.cpp b/common/view/view.cpp index 3c9c650d11..584ff5c698 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -1155,7 +1155,7 @@ void VIEW::Redraw() #ifdef KICAD_GAL_PROFILE totalRealTime.Stop(); - wxLogTrace( traceGalProfile, "VIEW::Redraw(): %.1f ms", totalRealTime.msecs() ); + wxLogTrace( traceGalProfile, wxS( "VIEW::Redraw(): %.1f ms" ), totalRealTime.msecs() ); #endif /* KICAD_GAL_PROFILE */ } @@ -1471,7 +1471,7 @@ void VIEW::UpdateItems() } } - KI_TRACE( traceGalProfile, "View update: total items %u, geom %u anyUpdated %u\n", cntTotal, + KI_TRACE( traceGalProfile, wxS( "View update: total items %u, geom %u anyUpdated %u\n" ), cntTotal, cntGeomUpdate, (unsigned) anyUpdated ); } diff --git a/common/widgets/bitmap_button.cpp b/common/widgets/bitmap_button.cpp index 86cb22f509..5b0925c253 100644 --- a/common/widgets/bitmap_button.cpp +++ b/common/widgets/bitmap_button.cpp @@ -343,7 +343,7 @@ void BITMAP_BUTTON::SetIsSeparator() void BITMAP_BUTTON::Check( bool aCheck ) { - wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), "Button is not a checkButton." ); + wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), wxS( "Button is not a checkButton." ) ); if( aCheck && !hasFlag( wxCONTROL_CHECKED ) ) { @@ -361,7 +361,7 @@ void BITMAP_BUTTON::Check( bool aCheck ) bool BITMAP_BUTTON::IsChecked() const { - wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), "Button is not a checkButton." ); + wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), wxS( "Button is not a checkButton." ) ); return hasFlag( wxCONTROL_CHECKED ); } \ No newline at end of file diff --git a/common/widgets/color_swatch.cpp b/common/widgets/color_swatch.cpp index 4453eece16..b142dce82a 100644 --- a/common/widgets/color_swatch.cpp +++ b/common/widgets/color_swatch.cpp @@ -120,7 +120,7 @@ COLOR_SWATCH::COLOR_SWATCH( wxWindow* aParent, const COLOR4D& aColor, int aID, m_readOnly( false ), m_supportsOpacity( true ) { - wxASSERT_MSG( aSwatchSize != SWATCH_EXPAND, "SWATCH_EXPAND not supported in COLOR_SWATCH" ); + wxASSERT_MSG( aSwatchSize != SWATCH_EXPAND, wxS( "SWATCH_EXPAND not supported in COLOR_SWATCH" ) ); switch( aSwatchSize ) { diff --git a/common/widgets/footprint_choice.cpp b/common/widgets/footprint_choice.cpp index e803d09b21..4a3ebb061a 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 ) == "" ) + if( SafeGetString( aItem ) == wxS( "" ) ) 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 ) == "" ) + if( SafeGetString( aItem ) == wxS( "" ) ) 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 ) != "" ) + if( SafeGetString( item ) != wxS( "" ) ) aEvent.Skip(); } diff --git a/common/widgets/footprint_select_widget.cpp b/common/widgets/footprint_select_widget.cpp index a6052312e9..1078e3a15d 100644 --- a/common/widgets/footprint_select_widget.cpp +++ b/common/widgets/footprint_select_widget.cpp @@ -139,14 +139,14 @@ bool FOOTPRINT_SELECT_WIDGET::UpdateList() m_fp_sel_ctrl->Append( m_default_footprint.IsEmpty() ? _( "No default footprint" ) : - "[" + _( "Default" ) + "] " + m_default_footprint, + wxS( "[" ) + _( "Default" ) + wxS( "] " ) + m_default_footprint, new wxStringClientData( m_default_footprint ) ); if( !m_zero_filter ) { for( FOOTPRINT_INFO& fpinfo : m_fp_filter ) { - wxString display_name( fpinfo.GetLibNickname() + ":" + fpinfo.GetFootprintName() ); + wxString display_name( fpinfo.GetLibNickname() + wxS( ":" ) + fpinfo.GetFootprintName() ); m_fp_sel_ctrl->Append( display_name, new wxStringClientData( display_name ) ); ++n_items; diff --git a/common/widgets/number_badge.cpp b/common/widgets/number_badge.cpp index 760e285c08..80807bfacf 100644 --- a/common/widgets/number_badge.cpp +++ b/common/widgets/number_badge.cpp @@ -139,11 +139,11 @@ void NUMBER_BADGE::computeSize() // Determine the size using the string "m999{+}" where the 'm' on the front serves as a margin // so the number isn't too close to the curved edge. - test = "m"; + test = wxS( "m" ); test.Pad( len, '9' ); if( m_currentNumber > m_maxNumber ) - test += "+"; + test += wxS( "+" ); dc.SetFont( wxFont( m_textSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, BADGE_FONTWEIGHT ) ); wxSize size = dc.GetTextExtent( test ); diff --git a/common/widgets/properties_panel.cpp b/common/widgets/properties_panel.cpp index bc219cc3da..7229c10599 100644 --- a/common/widgets/properties_panel.cpp +++ b/common/widgets/properties_panel.cpp @@ -255,7 +255,7 @@ void PROPERTIES_PANEL::update( const SELECTION& aSelection ) if( !converted ) { - wxFAIL_MSG( "Could not convert wxAny to wxVariant" ); + wxFAIL_MSG( wxS( "Could not convert wxAny to wxVariant" ) ); available = false; break; } @@ -345,7 +345,7 @@ void PROPERTIES_PANEL::onCharHook( wxKeyEvent& aEvent ) m_grid->CommitChangesFromEditor(); /* don't skip this one; if we're not the last property we'll also go to the next row */ } - + aEvent.Skip(); } diff --git a/common/widgets/split_button.cpp b/common/widgets/split_button.cpp index 6a9fb74e72..6916a0edff 100644 --- a/common/widgets/split_button.cpp +++ b/common/widgets/split_button.cpp @@ -30,19 +30,19 @@ #include #include #include -#include +#include #include SPLIT_BUTTON::SPLIT_BUTTON( wxWindow* aParent, wxWindowID aId, const wxString& aLabel, const wxPoint& aPos, const wxSize& aSize ) : - wxPanel( aParent, aId, aPos, aSize, wxBORDER_NONE | wxTAB_TRAVERSAL, "DropDownButton" ), + wxPanel( aParent, aId, aPos, aSize, wxBORDER_NONE | wxTAB_TRAVERSAL, wxS( "DropDownButton" ) ), m_label( aLabel ) { if( aSize == wxDefaultSize ) { #if wxCHECK_VERSION( 3, 1, 3 ) wxSize defaultSize = wxButton::GetDefaultSize( aParent ); - #else + #else wxSize defaultSize = wxButton::GetDefaultSize(); #endif diff --git a/common/widgets/std_bitmap_button.cpp b/common/widgets/std_bitmap_button.cpp index d079f75e23..3b5a7b1020 100644 --- a/common/widgets/std_bitmap_button.cpp +++ b/common/widgets/std_bitmap_button.cpp @@ -29,20 +29,20 @@ #include #include #include -#include +#include #include STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxBitmap& aDummyBitmap, const wxPoint& aPos, const wxSize& aSize, int aStyle ) : - wxPanel( aParent, aId, aPos, aSize, aStyle, "StdBitmapButton" ) + wxPanel( aParent, aId, aPos, aSize, aStyle, wxS( "StdBitmapButton" ) ) { if( aSize == wxDefaultSize ) { #if wxCHECK_VERSION( 3, 1, 3 ) wxSize defaultSize = wxButton::GetDefaultSize( aParent ); - #else + #else wxSize defaultSize = wxButton::GetDefaultSize(); #endif @@ -56,7 +56,7 @@ STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, Bind( wxEVT_LEAVE_WINDOW, &STD_BITMAP_BUTTON::OnMouseLeave, this ); Bind( wxEVT_ENTER_WINDOW, &STD_BITMAP_BUTTON::OnMouseEnter, this ); - Bind( wxEVT_SYS_COLOUR_CHANGED, + Bind( wxEVT_SYS_COLOUR_CHANGED, wxSysColourChangedEventHandler( STD_BITMAP_BUTTON::onThemeChanged ), this ); } diff --git a/common/widgets/ui_common.cpp b/common/widgets/ui_common.cpp index b9ce334254..c67c38bc20 100644 --- a/common/widgets/ui_common.cpp +++ b/common/widgets/ui_common.cpp @@ -91,7 +91,7 @@ wxFont KIUI::GetMonospacedUIFont() #ifdef __WXMAC__ // https://trac.wxwidgets.org/ticket/19210 if( font.GetFaceName().IsEmpty() ) - font.SetFaceName( "Menlo" ); + font.SetFaceName( wxS( "Menlo" ) ); #endif return font; @@ -119,7 +119,7 @@ wxFont getGUIFont( wxWindow* aWindow, int aRelativeSize ) #ifdef __WXMAC__ // https://trac.wxwidgets.org/ticket/19210 if( font.GetFaceName().IsEmpty() ) - font.SetFaceName( "San Francisco" ); + font.SetFaceName( wxS( "San Francisco" ) ); // OSX 10.1 .. 10.9: Lucida Grande // OSX 10.10: Helvetica Neue // OSX 10.11 .. : San Francisco diff --git a/common/widgets/widget_hotkey_list.cpp b/common/widgets/widget_hotkey_list.cpp index 28b0bf5038..72e56758d7 100644 --- a/common/widgets/widget_hotkey_list.cpp +++ b/common/widgets/widget_hotkey_list.cpp @@ -301,7 +301,7 @@ void WIDGET_HOTKEY_LIST::updateFromClientData() // mark unsaved changes if( changed_hk.m_EditKeycode != changed_hk.m_Actions[ 0 ]->GetHotKey() ) - label += " *"; + label += wxS( " *" ); description.Replace( wxS( "\n" ), wxS( " " ) ); description.Replace( wxS( "\r" ), wxS( " " ) ); @@ -467,7 +467,7 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey wxString command_header = _( "Command" ); if( !m_readOnly ) - command_header << " " << _( "(double-click to edit)" ); + command_header << wxS( " " ) << _( "(double-click to edit)" ); AppendColumn( command_header, 450, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE ); AppendColumn( _( "Hotkey" ), 120, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE ); @@ -495,8 +495,8 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey std::vector reserved_keys = { - "Ctrl+Tab", - "Ctrl+Shift+Tab" + wxS( "Ctrl+Tab" ), + wxS( "Ctrl+Shift+Tab" ) }; for( const wxString& key : reserved_keys ) @@ -506,7 +506,7 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey if( code ) m_reservedHotkeys[code] = key; else - wxLogWarning( "Unknown reserved keycode %s\n", key ); + wxLogWarning( wxS( "Unknown reserved keycode %s\n" ), key ); } GetDataView()->SetIndent( 10 ); diff --git a/common/widgets/wx_grid.cpp b/common/widgets/wx_grid.cpp index 7a52ee50c1..35e21f5d6b 100644 --- a/common/widgets/wx_grid.cpp +++ b/common/widgets/wx_grid.cpp @@ -524,7 +524,7 @@ int WX_GRID::GetVisibleWidth( int aCol, bool aHeader, bool aContents, bool aKeep size = GetRowLabelSize(); for( int row = 0; aContents && row < GetNumberRows(); row++ ) - size = std::max( size, int( GetTextExtent( GetRowLabelValue( row ) + "M" ).x ) ); + size = std::max( size, int( GetTextExtent( GetRowLabelValue( row ) + wxS( "M" ) ).x ) ); } else { @@ -537,14 +537,14 @@ int WX_GRID::GetVisibleWidth( int aCol, bool aHeader, bool aContents, bool aKeep { EnsureColLabelsVisible(); - size = std::max( size, int( GetTextExtent( GetColLabelValue( aCol ) + "M" ).x ) ); + size = std::max( size, int( GetTextExtent( GetColLabelValue( aCol ) + wxS( "M" ) ).x ) ); } for( int row = 0; aContents && row < GetNumberRows(); row++ ) { // If we have text, get the size. Otherwise, use a placeholder for the checkbox if( GetTable()->CanGetValueAs( row, aCol, wxGRID_VALUE_STRING ) ) - size = std::max( size, GetTextExtent( GetCellValue( row, aCol ) + "M" ).x ); + size = std::max( size, GetTextExtent( GetCellValue( row, aCol ) + wxS( "M" ) ).x ); else size = std::max( size, GetTextExtent( "MM" ).x ); } diff --git a/common/widgets/wx_html_report_panel.cpp b/common/widgets/wx_html_report_panel.cpp index 5d07b7b10c..f7e0552a3c 100644 --- a/common/widgets/wx_html_report_panel.cpp +++ b/common/widgets/wx_html_report_panel.cpp @@ -189,20 +189,20 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine ) switch( aLine.severity ) { case RPT_SEVERITY_ERROR: - retv = "" + _( "Error:" ) + " " - "" + aLine.message + "
"; + retv = wxS( "" ) + _( "Error:" ) + wxS( " " ) + wxS( "" ) + aLine.message + wxS( "
" ); break; case RPT_SEVERITY_WARNING: - retv = "" + _( "Warning:" ) + wxS( " " ) + aLine.message + "
"; + retv = wxS( "" ) + _( "Warning:" ) + wxS( " " ) + aLine.message + wxS( "
" ); break; case RPT_SEVERITY_INFO: - retv = "" + aLine.message + "
"; + retv = wxS( "" ) + aLine.message + wxS( "
" ); break; case RPT_SEVERITY_ACTION: - retv = "" + aLine.message + "
"; + retv = wxS( "" ) + aLine.message + wxS( "
" ); break; default: - retv = "" + aLine.message + "
"; + retv = wxS( "" ) + aLine.message + wxS( "
" ); } } else @@ -210,26 +210,26 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine ) switch( aLine.severity ) { case RPT_SEVERITY_ERROR: - retv = "" + _( "Error:" ) + " " - "" + aLine.message + "
"; + retv = wxS( "" ) + _( "Error:" ) + wxS( " " ) + wxS( "" ) + aLine.message + wxS( "
" ); break; case RPT_SEVERITY_WARNING: - retv = "" + _( "Warning:" ) + wxS( " " ) + aLine.message + "
"; + retv = wxS( "" ) + _( "Warning:" ) + wxS( " " ) + aLine.message + wxS( "
" ); break; case RPT_SEVERITY_INFO: - retv = "" + aLine.message + "
"; + retv = wxS( "" ) + aLine.message + wxS( "
" ); break; case RPT_SEVERITY_ACTION: - retv = "" + aLine.message + "
"; + retv = wxS( "" ) + aLine.message + wxS( "
" ); break; default: - retv = "" + aLine.message + "
"; + retv = wxS( "" ) + aLine.message + wxS( "
" ); } } // wxHtmlWindow fails to do correct baseline alignment between Japanese/Chinese cells and // Roman cells. This keeps the line in a single cell. - retv.Replace( " ", " " ); + retv.Replace( wxS( " " ), wxS( " " ) ); return retv; } diff --git a/common/wildcards_and_files_ext.cpp b/common/wildcards_and_files_ext.cpp index 011563a688..d0d941d690 100644 --- a/common/wildcards_and_files_ext.cpp +++ b/common/wildcards_and_files_ext.cpp @@ -88,23 +88,23 @@ wxString AddFileExtListToFilter( const std::vector& aExts ) { // The "all files" wildcard is different on different systems wxString filter; - filter << " (" << wxFileSelectorDefaultWildcardStr << ")|" + filter << wxS( " (" ) << wxFileSelectorDefaultWildcardStr << wxS( ")|" ) << wxFileSelectorDefaultWildcardStr; return filter; } - wxString files_filter = " ("; + wxString files_filter = wxS( " (" ); // Add extensions to the info message: for( const std::string& ext : aExts ) { if( files_filter.length() > 2 ) - files_filter << "; "; + files_filter << wxS( "; " ); files_filter << "*." << ext; } - files_filter << ")|*."; + files_filter << wxS( ")|*." ); // Add extensions to the filter list, using a formatted string (GTK specific): bool first = true; @@ -112,7 +112,7 @@ wxString AddFileExtListToFilter( const std::vector& aExts ) for( const std::string& ext : aExts ) { if( !first ) - files_filter << ";*."; + files_filter << wxS( ";*." ); first = false; diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index 8f7f1733c4..9e65956772 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -80,7 +80,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : m_tcFilterString = nullptr; m_FootprintsList = FOOTPRINT_LIST::GetInstance( Kiway() ); m_initialized = false; - m_aboutTitle = "CvPcb"; + m_aboutTitle = wxS( "CvPcb" ); // Give an icon wxIcon icon; diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index f39240d820..d9bea07d5b 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -127,13 +127,13 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa m_auimgr.SetManagedWindow( this ); CreateInfoBar(); - m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ) + m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) ) .Top().Layer( 6 ) ); - m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ) + m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( wxS( "OptToolbar" ) ) .Left().Layer( 3 ) ); - m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ) + m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) ) .Center() ); - m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ) + m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( wxS( "MsgPanel" ) ) .Bottom().Layer( 6 ) ); FinishAUIInitialization(); diff --git a/cvpcb/footprints_listbox.cpp b/cvpcb/footprints_listbox.cpp index abcfb9a3ca..8a865f39d3 100644 --- a/cvpcb/footprints_listbox.cpp +++ b/cvpcb/footprints_listbox.cpp @@ -158,7 +158,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a for( const FOOTPRINT_INFO& i : filter ) { - msg.Printf( "%3d %s:%s", + msg.Printf( wxS( "%3d %s:%s" ), int( newList.GetCount() + 1 ), i.GetLibNickname(), i.GetFootprintName() ); @@ -211,7 +211,7 @@ void FOOTPRINTS_LISTBOX::OnLeftDClick( wxListEvent& event ) void FOOTPRINTS_LISTBOX::OnChar( wxKeyEvent& event ) { - wxLogTrace( kicadTraceKeyEvent, "FOOTPRINTS_LISTBOX::OnChar %s", dump( event ) ); + wxLogTrace( kicadTraceKeyEvent, wxS( "FOOTPRINTS_LISTBOX::OnChar %s" ), dump( event ) ); int key = event.GetKeyCode(); diff --git a/cvpcb/library_listbox.cpp b/cvpcb/library_listbox.cpp index 2fd4f510be..b5784329a1 100644 --- a/cvpcb/library_listbox.cpp +++ b/cvpcb/library_listbox.cpp @@ -142,7 +142,7 @@ END_EVENT_TABLE() void LIBRARY_LISTBOX::OnChar( wxKeyEvent& event ) { - wxLogTrace( kicadTraceKeyEvent, "LIBRARY_LISTBOX::OnChar %s", dump( event ) ); + wxLogTrace( kicadTraceKeyEvent, wxS( "LIBRARY_LISTBOX::OnChar %s" ), dump( event ) ); int key = event.GetKeyCode(); diff --git a/cvpcb/listbox_base.cpp b/cvpcb/listbox_base.cpp index 909a0498bc..cbcaa934e3 100644 --- a/cvpcb/listbox_base.cpp +++ b/cvpcb/listbox_base.cpp @@ -82,7 +82,7 @@ void ITEMS_LISTBOX_BASE::UpdateLineWidth( unsigned aLine, wxClientDC& dc ) str = OnGetItemText( aLine, 0 ); else str = GetItemText( aLine, 0 ); - str += " "; + str += wxS( " " ); dc.GetTextExtent( str, &w, nullptr ); newWidth += w; diff --git a/cvpcb/menubar.cpp b/cvpcb/menubar.cpp index 0b60b64ca9..50b88461b2 100644 --- a/cvpcb/menubar.cpp +++ b/cvpcb/menubar.cpp @@ -71,7 +71,7 @@ void CVPCB_MAINFRAME::doReCreateMenuBar() // We can't use ACTIONS::showPreferences yet because wxWidgets moves this on // Mac, and it needs the wxID_PREFERENCES id to find it. - prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,", + prefsMenu->Add( _( "Preferences..." ) + wxS( "\tCtrl+," ), _( "Show preferences for all open tools" ), wxID_PREFERENCES, BITMAPS::preference ); diff --git a/cvpcb/symbols_listbox.cpp b/cvpcb/symbols_listbox.cpp index 9726510f59..57b4f7bb03 100644 --- a/cvpcb/symbols_listbox.cpp +++ b/cvpcb/symbols_listbox.cpp @@ -35,7 +35,7 @@ SYMBOLS_LISTBOX::SYMBOLS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id ) : - ITEMS_LISTBOX_BASE( parent, id ), + ITEMS_LISTBOX_BASE( parent, id ), m_warningAttr( std::make_unique() ) { m_warningAttr->SetBackgroundColour( KIPLATFORM::UI::IsDarkTheme() @@ -101,7 +101,7 @@ void SYMBOLS_LISTBOX::AppendWarning( int index ) void SYMBOLS_LISTBOX::RemoveWarning( int index ) { - if( auto const found{ std::find( m_symbolWarning.begin(), m_symbolWarning.end(), index ) }; + if( auto const found{ std::find( m_symbolWarning.begin(), m_symbolWarning.end(), index ) }; found != m_symbolWarning.end() ) { m_symbolWarning.erase( found ); @@ -121,7 +121,7 @@ wxListItemAttr* SYMBOLS_LISTBOX::OnGetItemAttr( long item ) const { return m_warningAttr.get(); } - return nullptr; + return nullptr; } @@ -144,7 +144,7 @@ void SYMBOLS_LISTBOX::SetSelection( int index, bool State ) void SYMBOLS_LISTBOX::OnChar( wxKeyEvent& event ) { - wxLogTrace( kicadTraceKeyEvent, "SYMBOLS_LISTBOX::OnChar %s", dump( event ) ); + wxLogTrace( kicadTraceKeyEvent, wxS( "SYMBOLS_LISTBOX::OnChar %s" ), dump( event ) ); int key = event.GetKeyCode(); diff --git a/eeschema/autoplace_fields.cpp b/eeschema/autoplace_fields.cpp index b4d0e194c5..165a9f59b1 100644 --- a/eeschema/autoplace_fields.cpp +++ b/eeschema/autoplace_fields.cpp @@ -150,7 +150,7 @@ public: for( unsigned field_idx = 0; field_idx < m_fields.size(); ++field_idx ) { SCH_FIELD* field = m_fields[field_idx]; - + if( !field->IsVisible() || !field->CanAutoplace() ) continue; @@ -248,7 +248,7 @@ protected: case PIN_UP: return SIDE_BOTTOM; case PIN_DOWN: return SIDE_TOP; default: - wxFAIL_MSG( "Invalid pin orientation" ); + wxFAIL_MSG( wxS( "Invalid pin orientation" ) ); return SIDE_LEFT; } } @@ -278,7 +278,7 @@ protected: */ void getPossibleCollisions( std::vector& aItems ) { - wxCHECK_RET( m_screen, "getPossibleCollisions() with null m_screen" ); + wxCHECK_RET( m_screen, wxS( "getPossibleCollisions() with null m_screen" ) ); BOX2I symbolBox = m_symbol->GetBodyAndPinsBoundingBox(); std::vector sides = getPreferredSides(); @@ -670,7 +670,7 @@ protected: field_xcoord = aFieldBox.GetRight(); break; default: - wxFAIL_MSG( "Unexpected value for SCH_FIELD::GetHorizJustify()" ); + wxFAIL_MSG( wxS( "Unexpected value for SCH_FIELD::GetHorizJustify()" ) ); field_xcoord = aFieldBox.Centre().x; // Most are centered } @@ -739,7 +739,7 @@ const AUTOPLACER::SIDE AUTOPLACER::SIDE_RIGHT( 1, 0 ); void SCH_SYMBOL::AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) { if( aManual ) - wxASSERT_MSG( aScreen, "A SCH_SCREEN pointer must be given for manual autoplacement" ); + wxASSERT_MSG( aScreen, wxS( "A SCH_SCREEN pointer must be given for manual autoplacement" ) ); AUTOPLACER autoplacer( this, aScreen ); autoplacer.DoAutoplace( aManual ); diff --git a/eeschema/bom_plugins.cpp b/eeschema/bom_plugins.cpp index 7a1fec41b6..53641f42a2 100644 --- a/eeschema/bom_plugins.cpp +++ b/eeschema/bom_plugins.cpp @@ -60,7 +60,7 @@ BOM_GENERATOR_HANDLER::BOM_GENERATOR_HANDLER( const wxString& aFile ) if( extension == wxS( "xsl" ) ) { m_info = readHeader( wxS( "-->" ) ); - m_cmd = wxString::Format( "xsltproc -o \"%%O%s\" \"%s\" \"%%I\"", + m_cmd = wxString::Format( wxS( "xsltproc -o \"%%O%s\" \"%s\" \"%%I\"" ), getOutputExtension( m_info ), m_file.GetFullPath() ); } @@ -110,7 +110,7 @@ BOM_GENERATOR_HANDLER::BOM_GENERATOR_HANDLER( const wxString& aFile ) else if( extension == wxS( "pyw" ) ) { m_info = readHeader( wxS( "\"\"\"" ) ); - m_cmd = wxString::Format( "pythonw \"%s/%s\" \"%%I\" \"%%O%s\"", + m_cmd = wxString::Format( wxS( "pythonw \"%s/%s\" \"%%I\" \"%%O%s\"" ), m_file.GetPath(), m_file.GetFullName(), getOutputExtension( m_info ) ); @@ -121,7 +121,7 @@ BOM_GENERATOR_HANDLER::BOM_GENERATOR_HANDLER( const wxString& aFile ) m_cmd = m_file.GetFullPath(); } - wxLogTrace( BOM_TRACE, "%s: extracted command line %s", m_name, m_cmd ); + wxLogTrace( BOM_TRACE, wxS( "%s: extracted command line %s" ), m_name, m_cmd ); } @@ -145,7 +145,7 @@ wxString BOM_GENERATOR_HANDLER::readHeader( const wxString& aEndSection ) if( aEndSection.IsEmpty() ) return wxEmptyString; - wxFFile fdata( m_file.GetFullPath(), "rb" ); // dtor will close the file + wxFFile fdata( m_file.GetFullPath(), wxS( "rb" ) ); // dtor will close the file wxString data; if( !fdata.ReadAll( &data ) ) @@ -177,7 +177,7 @@ wxString BOM_GENERATOR_HANDLER::getOutputExtension( const wxString& aHeader ) { // search header for extension after %O (extension includes '.') // looks for output argument of the form `"%O.extension"` - const wxString outputarg( "\"%O" ); + const wxString outputarg( wxS( "\"%O" ) ); int strstart = aHeader.Find( outputarg ); @@ -185,7 +185,7 @@ wxString BOM_GENERATOR_HANDLER::getOutputExtension( const wxString& aHeader ) return wxEmptyString; strstart += outputarg.Length(); - int strend = aHeader.find( "\"", strstart ); + int strend = aHeader.find( wxS( "\"" ), strstart ); if( strend == wxNOT_FOUND ) return wxEmptyString; diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 2dcd19644e..174acd9dc8 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -236,7 +236,7 @@ wxString CONNECTION_SUBGRAPH::GetNetName() const if( !m_driver->Connection( &m_sheet ) ) { #ifdef CONNECTIVITY_DEBUG - wxASSERT_MSG( false, "Tried to get the net name of an item with no connection" ); + wxASSERT_MSG( false, wxS( "Tried to get the net name of an item with no connection" ) ); #endif return ""; @@ -297,7 +297,7 @@ wxString CONNECTION_SUBGRAPH::driverName( SCH_ITEM* aItem ) const } default: - wxFAIL_MSG( "Unhandled item type in GetNameForDriver" ); + wxFAIL_MSG( wxS( "Unhandled item type in GetNameForDriver" ) ); break; } @@ -779,7 +779,7 @@ void CONNECTION_GRAPH::updateItemConnectivity( const SCH_SHEET_PATH& aSheet, void CONNECTION_GRAPH::buildItemSubGraphs() { // Recache all bus aliases for later use - wxCHECK_RET( m_schematic, "Connection graph cannot be built without schematic pointer" ); + wxCHECK_RET( m_schematic, wxS( "Connection graph cannot be built without schematic pointer" ) ); SCH_SHEET_LIST all_sheets = m_schematic->GetSheets(); @@ -991,7 +991,7 @@ void CONNECTION_GRAPH::collectAllDriverValues() { UNITS_PROVIDER unitsProvider( schIUScale, EDA_UNITS::MILLIMETRES ); - wxLogTrace( ConnTrace, "Unexpected strong driver %s", + wxLogTrace( ConnTrace, wxS( "Unexpected strong driver %s" ), driver->GetItemDescription( &unitsProvider ) ); break; } @@ -1136,7 +1136,7 @@ void CONNECTION_GRAPH::processSubGraphs() while( m_net_name_to_subgraphs_map.count( new_name ) ) new_name = create_new_name( connection ); - wxLogTrace( ConnTrace, "%ld (%s) is weakly driven and not unique. Changing to %s.", + wxLogTrace( ConnTrace, wxS( "%ld (%s) is weakly driven and not unique. Changing to %s." ), subgraph->m_code, name, new_name ); alg::delete_matching( *vec, subgraph ); @@ -1177,7 +1177,7 @@ void CONNECTION_GRAPH::processSubGraphs() if( conflict ) { wxLogTrace( ConnTrace, - "%ld (%s) skipped for promotion due to potential conflict", + wxS( "%ld (%s) skipped for promotion due to potential conflict" ), subgraph->m_code, name ); } else @@ -1185,7 +1185,7 @@ void CONNECTION_GRAPH::processSubGraphs() UNITS_PROVIDER unitsProvider( schIUScale, EDA_UNITS::MILLIMETRES ); wxLogTrace( ConnTrace, - "%ld (%s) weakly driven by unique sheet pin %s, promoting", + wxS( "%ld (%s) weakly driven by unique sheet pin %s, promoting" ), subgraph->m_code, name, subgraph->m_driver->GetItemDescription( &unitsProvider ) ); @@ -1277,7 +1277,7 @@ void CONNECTION_GRAPH::processSubGraphs() connections_to_check.push_back( c ); wxLogTrace( ConnTrace, - "%lu (%s): Adding secondary driver %s", aSubgraph->m_code, + wxS( "%lu (%s): Adding secondary driver %s" ), aSubgraph->m_code, aSubgraph->m_driver_connection->Name( true ), c->Name( true ) ); } @@ -1356,7 +1356,7 @@ void CONNECTION_GRAPH::processSubGraphs() { if( connection->IsBus() && candidate->m_driver_connection->IsNet() ) { - wxLogTrace( ConnTrace, "%lu (%s) has bus child %lu (%s)", subgraph->m_code, + wxLogTrace( ConnTrace, wxS( "%lu (%s) has bus child %lu (%s)" ), subgraph->m_code, connection->Name(), candidate->m_code, member->Name() ); subgraph->m_bus_neighbors[member].insert( candidate ); @@ -1364,7 +1364,7 @@ void CONNECTION_GRAPH::processSubGraphs() } else { - wxLogTrace( ConnTrace, "%lu (%s) absorbs neighbor %lu (%s)", + wxLogTrace( ConnTrace, wxS( "%lu (%s) absorbs neighbor %lu (%s)" ), subgraph->m_code, connection->Name(), candidate->m_code, candidate->m_driver_connection->Name() ); @@ -1392,7 +1392,7 @@ void CONNECTION_GRAPH::processSubGraphs() else assignNewNetCode( *subgraph->m_driver_connection ); - wxLogTrace( ConnTrace, "Re-resolving drivers for %lu (%s)", subgraph->m_code, + wxLogTrace( ConnTrace, wxS( "Re-resolving drivers for %lu (%s)" ), subgraph->m_code, subgraph->m_driver_connection->Name() ); } @@ -1488,7 +1488,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function* a if( !subgraph->m_dirty ) continue; - wxLogTrace( ConnTrace, "Processing %lu (%s) for propagation", subgraph->m_code, + wxLogTrace( ConnTrace, wxS( "Processing %lu (%s) for propagation" ), subgraph->m_code, subgraph->m_driver_connection->Name() ); // For subgraphs that are driven by a global (power port or label) and have more @@ -1522,7 +1522,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function* a if( conn->Name() == secondary_name ) { - wxLogTrace( ConnTrace, "Global %lu (%s) promoted to %s", candidate->m_code, + wxLogTrace( ConnTrace, wxS( "Global %lu (%s) promoted to %s" ), candidate->m_code, conn->Name(), subgraph->m_driver_connection->Name() ); conn->Clone( *subgraph->m_driver_connection ); @@ -1560,14 +1560,14 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function* a for( CONNECTION_SUBGRAPH* subgraph : m_driver_subgraphs ) { // All SGs should have been processed by propagateToNeighbors above - wxASSERT_MSG( !subgraph->m_dirty, "Subgraph not processed by propagateToNeighbors!" ); + wxASSERT_MSG( !subgraph->m_dirty, wxS( "Subgraph not processed by propagateToNeighbors!" ) ); if( subgraph->m_bus_parents.size() < 2 ) continue; SCH_CONNECTION* conn = subgraph->m_driver_connection; - wxLogTrace( ConnTrace, "%lu (%s) has multiple bus parents", + wxLogTrace( ConnTrace, wxS( "%lu (%s) has multiple bus parents" ), subgraph->m_code, conn->Name() ); wxASSERT( conn->IsNet() ); @@ -1585,7 +1585,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function* a if( !match ) { - wxLogTrace( ConnTrace, "Warning: could not match %s inside %lu (%s)", + wxLogTrace( ConnTrace, wxS( "Warning: could not match %s inside %lu (%s)" ), conn->Name(), parent->m_code, parent->m_driver_connection->Name() ); continue; } @@ -1594,7 +1594,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function* a { wxString old_name = match->Name(); - wxLogTrace( ConnTrace, "Updating %lu (%s) member %s to %s", parent->m_code, + wxLogTrace( ConnTrace, wxS( "Updating %lu (%s) member %s to %s" ), parent->m_code, parent->m_driver_connection->Name(), old_name, conn->Name() ); match->Clone( *conn ); @@ -1841,7 +1841,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo { if( candidate->GetNameForDriver( label ) == aParent->GetNameForDriver( pin ) ) { - wxLogTrace( ConnTrace, "%lu: found child %lu (%s)", aParent->m_code, + wxLogTrace( ConnTrace, wxS( "%lu: found child %lu (%s)" ), aParent->m_code, candidate->m_code, candidate->m_driver_connection->Name() ); candidate->m_hier_parent = aParent; @@ -1888,7 +1888,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo if( aParent->GetNameForDriver( label ) == candidate->GetNameForDriver( pin ) ) { - wxLogTrace( ConnTrace, "%lu: found additional parent %lu (%s)", + wxLogTrace( ConnTrace, wxS( "%lu: found additional parent %lu (%s)" ), aParent->m_code, candidate->m_code, candidate->m_driver_connection->Name() ); @@ -1943,7 +1943,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo // This is bad, probably an ERC error if( !member ) { - wxLogTrace( ConnTrace, "Could not match bus member %s in %s", + wxLogTrace( ConnTrace, wxS( "Could not match bus member %s in %s" ), kv.first->Name(), parent->Name() ); continue; } @@ -1962,7 +1962,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo // Safety check against infinite recursion wxASSERT( neighbor_conn->IsNet() ); - wxLogTrace( ConnTrace, "%lu (%s) connected to bus member %s (local %s)", + wxLogTrace( ConnTrace, wxS( "%lu (%s) connected to bus member %s (local %s)" ), neighbor->m_code, neighbor_name, member->Name(), member->LocalName() ); // Take whichever name is higher priority @@ -1995,13 +1995,13 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo // on which subgraph comes up first) if( !aSubgraph->m_hier_ports.empty() && !aSubgraph->m_hier_pins.empty() ) { - wxLogTrace( ConnTrace, "%lu (%s) has both hier ports and pins; deferring processing", + wxLogTrace( ConnTrace, wxS( "%lu (%s) has both hier ports and pins; deferring processing" ), aSubgraph->m_code, conn->Name() ); return; } else if( aSubgraph->m_hier_ports.empty() && aSubgraph->m_hier_pins.empty() ) { - wxLogTrace( ConnTrace, "%lu (%s) has no hier pins or ports; marking clean", + wxLogTrace( ConnTrace, wxS( "%lu (%s) has no hier pins or ports; marking clean" ), aSubgraph->m_code, conn->Name() ); aSubgraph->m_dirty = false; return; @@ -2009,7 +2009,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo visited.insert( aSubgraph ); - wxLogTrace( ConnTrace, "Propagating %lu (%s) to subsheets", + wxLogTrace( ConnTrace, wxS( "Propagating %lu (%s) to subsheets" ), aSubgraph->m_code, aSubgraph->m_driver_connection->Name() ); visit( aSubgraph ); @@ -2072,7 +2072,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo if( bestDriver != aSubgraph ) { - wxLogTrace( ConnTrace, "%lu (%s) overridden by new driver %lu (%s)", + wxLogTrace( ConnTrace, wxS( "%lu (%s) overridden by new driver %lu (%s)" ), aSubgraph->m_code, aSubgraph->m_driver_connection->Name(), bestDriver->m_code, bestDriver->m_driver_connection->Name() ); } @@ -2106,12 +2106,12 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo if( !member ) { - wxLogTrace( ConnTrace, "WARNING: failed to match stale member %s in %s.", + wxLogTrace( ConnTrace, wxS( "WARNING: failed to match stale member %s in %s." ), stale_member->Name(), subgraph->m_driver_connection->Name() ); continue; } - wxLogTrace( ConnTrace, "Updating %lu (%s) member %s to %s", subgraph->m_code, + wxLogTrace( ConnTrace, wxS( "Updating %lu (%s) member %s to %s" ), subgraph->m_code, subgraph->m_driver_connection->Name(), member->LocalName(), stale_member->Name() ); @@ -2228,7 +2228,7 @@ void CONNECTION_GRAPH::recacheSubgraphName( CONNECTION_SUBGRAPH* aSubgraph, alg::delete_matching( vec, aSubgraph ); } - wxLogTrace( ConnTrace, "recacheSubgraphName: %s => %s", aOldName, + wxLogTrace( ConnTrace, wxS( "recacheSubgraphName: %s => %s" ), aOldName, aSubgraph->m_driver_connection->Name() ); m_net_name_to_subgraphs_map[aSubgraph->m_driver_connection->Name()].push_back( aSubgraph ); @@ -2279,7 +2279,7 @@ std::vector CONNECTION_GRAPH::GetBusesNeedingMigrati if( !different ) continue; - wxLogTrace( ConnTrace, "SG %ld (%s) has multiple bus labels", subgraph->m_code, + wxLogTrace( ConnTrace, wxS( "SG %ld (%s) has multiple bus labels" ), subgraph->m_code, connection->Name() ); ret.push_back( subgraph ); @@ -2365,7 +2365,7 @@ int CONNECTION_GRAPH::RunERC() { int error_count = 0; - wxCHECK_MSG( m_schematic, true, "Null m_schematic in CONNECTION_GRAPH::RunERC" ); + wxCHECK_MSG( m_schematic, true, wxS( "Null m_schematic in CONNECTION_GRAPH::RunERC" ) ); ERC_SETTINGS& settings = m_schematic->ErcSettings(); @@ -3152,7 +3152,7 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph ) wxString netName = GetResolvedSubgraphName( aSubgraph ); - wxCHECK_MSG( m_schematic, true, "Null m_schematic in CONNECTION_GRAPH::ercCheckLabels" ); + wxCHECK_MSG( m_schematic, true, wxS( "Null m_schematic in CONNECTION_GRAPH::ercCheckLabels" ) ); // Labels that have multiple pins connected are not dangling (may be used for naming segments) // so leave them without errors here diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 4d9e4122f1..3452cf05ca 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -478,11 +478,11 @@ bool findSymbolsAndPins( wxString fullRef = schRef.GetRef() + refNum; // Skip power symbols - if( fullRef.StartsWith( "#" ) ) + if( fullRef.StartsWith( wxS( "#" ) ) ) continue; // Unannotated symbols are not supported - if( refNum.compare( "?" ) == 0 ) + if( refNum.compare( wxS( "?" ) ) == 0 ) continue; // Look for whole footprint @@ -570,11 +570,11 @@ bool sheetContainsOnlyWantedItems( wxString fullRef = schRef.GetRef() + refNum; // Skip power symbols - if( fullRef.StartsWith( "#" ) ) + if( fullRef.StartsWith( wxS( "#" ) ) ) continue; // Unannotated symbols are not supported - if( refNum.compare( "?" ) == 0 ) + if( refNum.compare( wxS( "?" ) ) == 0 ) continue; if( aSyncSymMap.find( fullRef ) == aSyncSymMap.end() ) @@ -599,7 +599,7 @@ std::optional>> findItemsFromSyncSelection( const SCHEMATIC& aSchematic, const std::string aSyncStr, bool aFocusOnFirst ) { - wxArrayString syncArray = wxStringTokenize( aSyncStr, "," ); + wxArrayString syncArray = wxStringTokenize( aSyncStr, wxS( "," ) ); std::unordered_map> syncSymMap; std::unordered_map> syncPinMap; diff --git a/eeschema/dialogs/dialog_bom.cpp b/eeschema/dialogs/dialog_bom.cpp index 025e6ff951..47f18a1469 100644 --- a/eeschema/dialogs/dialog_bom.cpp +++ b/eeschema/dialogs/dialog_bom.cpp @@ -212,7 +212,7 @@ void DIALOG_BOM::installGeneratorsList() if( !m_generators[ii]->FindFilePath().Exists( wxFILE_EXISTS_REGULAR ) ) { - wxLogTrace( BOM_TRACE, "BOM plugin %s not found", + wxLogTrace( BOM_TRACE, wxS( "BOM plugin %s not found" ), m_generators[ii]->FindFilePath().GetFullName() ); name.Append( wxT( " " ) + _( "(file missing)" ) ); diff --git a/eeschema/dialogs/dialog_change_symbols.cpp b/eeschema/dialogs/dialog_change_symbols.cpp index 1b31768ecb..df7e6f5c5c 100644 --- a/eeschema/dialogs/dialog_change_symbols.cpp +++ b/eeschema/dialogs/dialog_change_symbols.cpp @@ -564,7 +564,7 @@ bool DIALOG_CHANGE_SYMBOLS::processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_ if( !libSymbol ) { - msg << ": " << _( "*** symbol not found ***" ); + msg << wxS( ": " ) << _( "*** symbol not found ***" ); m_messagePanel->Report( msg, RPT_SEVERITY_ERROR ); return false; } @@ -573,7 +573,7 @@ bool DIALOG_CHANGE_SYMBOLS::processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_ if( flattenedSymbol->GetUnitCount() < aSymbol->GetUnit() ) { - msg << ": " << _( "*** new symbol has too few units ***" ); + msg << wxS( ": " ) << _( "*** new symbol has too few units ***" ); m_messagePanel->Report( msg, RPT_SEVERITY_ERROR ); return false; } diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 4fda570cc5..22ba1d1fdc 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -925,7 +925,7 @@ void DIALOG_ERC::deleteAllMarkers( bool aIncludeExclusions ) void DIALOG_ERC::OnSaveReport( wxCommandEvent& aEvent ) { - wxFileName fn( "ERC." + ReportFileExtension ); + wxFileName fn( wxS( "ERC." ) + ReportFileExtension ); wxFileDialog dlg( this, _( "Save Report to File" ), Prj().GetProjectPath(), fn.GetFullName(), ReportFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); diff --git a/eeschema/dialogs/dialog_export_netlist.cpp b/eeschema/dialogs/dialog_export_netlist.cpp index af3b52cfe2..7e19d019e0 100644 --- a/eeschema/dialogs/dialog_export_netlist.cpp +++ b/eeschema/dialogs/dialog_export_netlist.cpp @@ -312,7 +312,7 @@ void DIALOG_EXPORT_NETLIST::OnRunExternSpiceCommand( wxCommandEvent& event ) // Build the command line wxString commandLine = simulatorCommand; - commandLine.Replace( "%I", fn.GetFullPath(), true ); + commandLine.Replace( wxS( "%I" ), fn.GetFullPath(), true ); if( m_Parent->ReadyToNetlist( _( "Simulator requires a fully annotated schematic." ) ) ) { diff --git a/eeschema/dialogs/dialog_field_properties.cpp b/eeschema/dialogs/dialog_field_properties.cpp index 54510e8dd2..8d5a62f768 100644 --- a/eeschema/dialogs/dialog_field_properties.cpp +++ b/eeschema/dialogs/dialog_field_properties.cpp @@ -503,7 +503,7 @@ DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES( SCH_BASE_FRAME* aParen m_isPower = false; - m_textLabel->SetLabel( aField->GetName() + ":" ); + m_textLabel->SetLabel( aField->GetName() + wxS( ":" ) ); m_position = m_field->GetPosition(); @@ -560,7 +560,7 @@ void DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded( wxStyledTextEvent &aEven { wxString text = m_StyledTextCtrl->GetText(); int currpos = m_StyledTextCtrl->GetCurrentPos(); - text.Replace( "\n", "" ); + text.Replace( wxS( "\n" ), wxS( "" ) ); m_StyledTextCtrl->SetText( text ); m_StyledTextCtrl->GotoPos( currpos-1 ); return; diff --git a/eeschema/dialogs/dialog_label_properties.cpp b/eeschema/dialogs/dialog_label_properties.cpp index 354e42e81f..4b26d1edcb 100644 --- a/eeschema/dialogs/dialog_label_properties.cpp +++ b/eeschema/dialogs/dialog_label_properties.cpp @@ -438,7 +438,7 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow() #ifdef __WXMAC__ // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting - text.Replace( "\r", "\n" ); + text.Replace( wxS( "\r" ), wxS( "\n" ) ); #endif if( text.IsEmpty() && !m_currentLabel->IsNew() ) diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp index 9dc228dd58..21ec75e7b6 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp +++ b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp @@ -665,11 +665,11 @@ private: static bool BoolFromString( wxString aValue ) { - if( aValue == "1" ) + if( aValue == wxS( "1" ) ) { return true; } - else if( aValue == "0" ) + else if( aValue == wxS( "0" ) ) { return false; } diff --git a/eeschema/dialogs/dialog_lib_textbox_properties.cpp b/eeschema/dialogs/dialog_lib_textbox_properties.cpp index 1f9428464d..86586ca0c0 100644 --- a/eeschema/dialogs/dialog_lib_textbox_properties.cpp +++ b/eeschema/dialogs/dialog_lib_textbox_properties.cpp @@ -250,11 +250,11 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataFromWindow() #ifdef __WXMAC__ // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting - text.Replace( "\r", "\n" ); + text.Replace( wxS( "\r" ), wxS( "\n" ) ); #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. - text.Replace( "\r", "" ); + text.Replace( wxS( "\r" ), wxS( "" ) ); #endif m_currentText->SetText( text ); diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index 3a3239a1fc..9e63f13f9d 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -1056,7 +1056,7 @@ void DIALOG_SIM_MODEL::onBrowseButtonClick( wxCommandEvent& a wxString path = dlg.GetPath(); wxFileName fn( path ); - if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( ".." ) ) + if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( wxS( ".." ) ) ) path = fn.GetFullPath(); loadLibrary( path, true ); diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 125933d33b..d538155bcf 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -1112,8 +1112,8 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnRemoveField( wxCommandEvent& event ) // Should never occur: "Remove Field..." button should be disabled if invalid selection // via OnFieldsCtrlSelectionChanged() - wxCHECK_RET( row != -1, "Some user defined field must be selected first" ); - wxCHECK_RET( row >= MANDATORY_FIELDS, "Mandatory fields cannot be removed" ); + wxCHECK_RET( row != -1, wxS( "Some user defined field must be selected first" ) ); + wxCHECK_RET( row >= MANDATORY_FIELDS, wxS( "Mandatory fields cannot be removed" ) ); wxString fieldName = m_fieldsCtrl->GetTextValue( row, 0 ); @@ -1415,9 +1415,9 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnExport( wxCommandEvent& aEvent ) continue; wxString escapedValue = m_grid->GetColLabelValue( col ); - escapedValue.Replace( "\"", "\"\"" ); + escapedValue.Replace( wxS( "\"" ), wxS( "\"\"" ) ); - wxString format = col == last_col ? "\"%s\"\r\n" : "\"%s\","; + wxString format = col == last_col ? wxS( "\"%s\"\r\n" ) : wxS( "\"%s\"," ); out.Write( wxString::Format( format, escapedValue ) ); } @@ -1436,9 +1436,9 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnExport( wxCommandEvent& aEvent ) // Get the unanottated version of the field, e.g. no "> " or "v " by wxString escapedValue = m_dataModel->GetRawValue( row, col ); - escapedValue.Replace( "\"", "\"\"" ); + escapedValue.Replace( wxS( "\"" ), wxS( "\"\"" ) ); - wxString format = col == last_col ? "\"%s\"\r\n" : "\"%s\","; + wxString format = col == last_col ? wxS( "\"%s\"\r\n" ) : wxS( "\"%s\"," ); out.Write( wxString::Format( format, escapedValue ) ); } diff --git a/eeschema/dialogs/dialog_symbol_properties.cpp b/eeschema/dialogs/dialog_symbol_properties.cpp index e7af1b3403..8a1b999cf3 100644 --- a/eeschema/dialogs/dialog_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_symbol_properties.cpp @@ -515,7 +515,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow() } #ifdef KICAD_SPICE - m_cbExcludeFromSim->SetValue( m_symbol->GetFieldText( SIM_ENABLE_FIELD ) == "0" ); + m_cbExcludeFromSim->SetValue( m_symbol->GetFieldText( SIM_ENABLE_FIELD ) == wxS( "0" ) ); #endif m_cbExcludeFromBom->SetValue( !m_symbol->GetIncludeInBom() ); m_cbExcludeFromBoard->SetValue( !m_symbol->GetIncludeOnBoard() ); @@ -1184,7 +1184,7 @@ void DIALOG_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) } } - m_cbExcludeFromSim->SetValue( simEnable == "0" ); + m_cbExcludeFromSim->SetValue( simEnable == wxS( "0" ) ); #endif } diff --git a/eeschema/dialogs/dialog_symbol_remap.cpp b/eeschema/dialogs/dialog_symbol_remap.cpp index 7a8bb4f3ce..34ecd15df9 100644 --- a/eeschema/dialogs/dialog_symbol_remap.cpp +++ b/eeschema/dialogs/dialog_symbol_remap.cpp @@ -182,7 +182,7 @@ void DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable( REPORTER& aReporter ) // Spaces in the file name will break the symbol name because they are not // quoted in the symbol library file format. - libName.Replace( " ", "-" ); + libName.Replace( wxS( " " ), wxS( "-" ) ); // Don't create duplicate table entries. while( alg::contains( libNames, libName ) ) @@ -445,7 +445,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter ) // Back up the cache library. srcFileName.SetPath( Prj().GetProjectPath() ); - srcFileName.SetName( Prj().GetProjectName() + "-cache" ); + srcFileName.SetName( Prj().GetProjectName() + wxS( "-cache" ) ); srcFileName.SetExt( LegacySymbolLibFileExtension ); destFileName = srcFileName; @@ -465,7 +465,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter ) } // Back up the rescue symbol library if it exists. - srcFileName.SetName( Prj().GetProjectName() + "-rescue" ); + srcFileName.SetName( Prj().GetProjectName() + wxS( "-rescue" ) ); destFileName.SetName( srcFileName.GetName() + timeStamp ); tmp.Printf( _( "Backing up file '%s' to '%s'." ), diff --git a/eeschema/dialogs/panel_setup_pinmap.cpp b/eeschema/dialogs/panel_setup_pinmap.cpp index 2bf09df4bf..8a2f60181a 100644 --- a/eeschema/dialogs/panel_setup_pinmap.cpp +++ b/eeschema/dialogs/panel_setup_pinmap.cpp @@ -120,7 +120,7 @@ void PANEL_SETUP_PINMAP::reBuildMatrixPanel() const int twiddle = 1; #endif - wxSize charSize = KIUI::GetTextSize( "X", m_matrixPanel ); + wxSize charSize = KIUI::GetTextSize( wxS( "X" ), m_matrixPanel ); wxPoint pos( 0, charSize.y * 2 ); wxStaticText* text; diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index c34bb47d11..98e4fa0e20 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/eeschema/dialogs/panel_sym_lib_table.cpp @@ -158,7 +158,7 @@ protected: // paste the SYMBOL_LIB_TABLE_ROWs of s-expression (sym_lib_table), starting // at column 0 regardless of current cursor column. - STRING_LINE_READER slr( TO_UTF8( cb_text ), "Clipboard" ); + STRING_LINE_READER slr( TO_UTF8( cb_text ), wxS( "Clipboard" ) ); LIB_TABLE_LEXER lexer( &slr ); SYMBOL_LIB_TABLE tmp_tbl; bool parsed = true; diff --git a/eeschema/dialogs/panel_template_fieldnames.cpp b/eeschema/dialogs/panel_template_fieldnames.cpp index 5c467d4ab2..2ec3732ab2 100644 --- a/eeschema/dialogs/panel_template_fieldnames.cpp +++ b/eeschema/dialogs/panel_template_fieldnames.cpp @@ -155,8 +155,8 @@ bool PANEL_TEMPLATE_FIELDNAMES::TransferDataToGrid() { m_grid->SetCellValue( row, 0, m_fields[row].m_Name ); // columns 1 and 2 show a boolean value (in a check box): - m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? "1" : "0" ); - m_grid->SetCellValue( row, 2, m_fields[row].m_URL ? "1" : "0" ); + m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? wxS( "1" ) : wxS( "0" ) ); + m_grid->SetCellValue( row, 2, m_fields[row].m_URL ? wxS( "1" ) : wxS( "0" ) ); // Set cell properties m_grid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE ); @@ -185,8 +185,8 @@ bool PANEL_TEMPLATE_FIELDNAMES::TransferDataFromGrid() for( int row = 0; row < m_grid->GetNumberRows(); ++row ) { m_fields[row].m_Name = m_grid->GetCellValue( row, 0 ); - m_fields[row].m_Visible = m_grid->GetCellValue( row, 1 ) == "1"; - m_fields[row].m_URL = m_grid->GetCellValue( row, 2 ) == "1"; + m_fields[row].m_Visible = m_grid->GetCellValue( row, 1 ) == wxS( "1" ); + m_fields[row].m_URL = m_grid->GetCellValue( row, 2 ) == wxS( "1" ); } return true; diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index 970be94b09..72dedf8761 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -419,7 +419,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje wxString msg; if( !aErrors.empty() ) - aErrors += "\n"; + aErrors += wxS( "\n" ); msg.Printf( _( "Cannot copy file '%s' as it will be overwritten by the new root " "sheet file." ), destFile.GetFullPath() ); @@ -446,11 +446,11 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje else if( ext == LegacySymbolLibFileExtension || ext == LegacySymbolDocumentFileExtension || ext == KiCadSymbolLibFileExtension ) { - if( destFile.GetName() == aProjectName + "-cache" ) - destFile.SetName( aNewProjectName + "-cache" ); + if( destFile.GetName() == aProjectName + wxS( "-cache" ) ) + destFile.SetName( aNewProjectName + wxS( "-cache" ) ); - if( destFile.GetName() == aProjectName + "-rescue" ) - destFile.SetName( aNewProjectName + "-rescue" ); + if( destFile.GetName() == aProjectName + wxS( "-rescue" ) ) + destFile.SetName( aNewProjectName + wxS( "-rescue" ) ); KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors ); } @@ -481,10 +481,10 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje else if( symNode ) path = symNode->m_value; - if( path == aProjectName + ".sch" ) - path = aNewProjectName + ".sch"; - else if( path == aProjectBasePath + "/" + aProjectName + ".sch" ) - path = aNewProjectBasePath + "/" + aNewProjectName + ".sch"; + if( path == aProjectName + wxS( ".sch" ) ) + path = aNewProjectName + wxS( ".sch" ); + else if( path == aProjectBasePath + "/" + aProjectName + wxS( ".sch" ) ) + path = aNewProjectBasePath + "/" + aNewProjectName + wxS( ".sch" ); else if( path.StartsWith( aProjectBasePath ) ) path.Replace( aProjectBasePath, aNewProjectBasePath, false ); @@ -512,13 +512,13 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje wxString msg; if( !aErrors.empty() ) - aErrors += "\n"; + aErrors += wxS( "\n" ); msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() ); aErrors += msg; } } - else if( destFile.GetName() == "sym-lib-table" ) + else if( destFile.GetName() == wxS( "sym-lib-table" ) ) { SYMBOL_LIB_TABLE symbolLibTable; symbolLibTable.Load( aSrcFilePath ); @@ -528,10 +528,12 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje LIB_TABLE_ROW& row = symbolLibTable.At( i ); wxString uri = row.GetFullURI(); - uri.Replace( "/" + aProjectName + "-cache.lib", "/" + aNewProjectName + "-cache.lib" ); - uri.Replace( "/" + aProjectName + "-rescue.lib", "/" + aNewProjectName + - "-rescue.lib" ); - uri.Replace( "/" + aProjectName + ".lib", "/" + aNewProjectName + ".lib" ); + uri.Replace( wxS( "/" ) + aProjectName + wxS( "-cache.lib" ), + wxS( "/" ) + aNewProjectName + wxS( "-cache.lib" ) ); + uri.Replace( wxS( "/" ) + aProjectName + wxS( "-rescue.lib" ), + wxS( "/" ) + aNewProjectName + wxS( "-rescue.lib" ) ); + uri.Replace( wxS( "/" ) + aProjectName + wxS( ".lib" ), + wxS( "/" ) + aNewProjectName + wxS( ".lib" ) ); row.SetFullURI( uri ); } @@ -553,7 +555,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje } else { - wxFAIL_MSG( "Unexpected filetype for Eeschema::SaveFileAs()" ); + wxFAIL_MSG( wxS( "Unexpected filetype for Eeschema::SaveFileAs()" ) ); } } diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index 60e02bcd57..3b8b49cf5e 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -989,7 +989,7 @@ void BOM_CFG_PARSER::parseGenerator() wxString option = FromUTF8(); - if( option.StartsWith( "nickname=", &str ) ) + if( option.StartsWith( wxS( "nickname=" ), &str ) ) settings.name = str; NeedRIGHT(); diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index 3e077b09e6..34a460f888 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -181,11 +181,11 @@ void ERC_TESTER::TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet ) if( aDrawingSheet ) { wsItems.SetMilsToIUfactor( schIUScale.IU_PER_MILS ); - wsItems.SetPageNumber( "1" ); + wsItems.SetPageNumber( wxS( "1" ) ); wsItems.SetSheetCount( 1 ); - wsItems.SetFileName( "dummyFilename" ); - wsItems.SetSheetName( "dummySheet" ); - wsItems.SetSheetLayer( "dummyLayer" ); + wsItems.SetFileName( wxS( "dummyFilename" ) ); + wsItems.SetSheetName( wxS( "dummySheet" ) ); + wsItems.SetSheetLayer( wxS( "dummyLayer" ) ); wsItems.SetProject( &m_schematic->Prj() ); wsItems.BuildDrawItemsList( aDrawingSheet->GetPageInfo(), aDrawingSheet->GetTitleBlock()); } diff --git a/eeschema/erc_item.cpp b/eeschema/erc_item.cpp index 16762fbfb9..e84b76e19e 100644 --- a/eeschema/erc_item.cpp +++ b/eeschema/erc_item.cpp @@ -269,7 +269,7 @@ std::shared_ptr ERC_ITEM::Create( int aErrorCode ) case ERCE_MISSING_BIDI_PIN: return std::make_shared( missingBidiPin ); case ERCE_UNSPECIFIED: default: - wxFAIL_MSG( "Unknown ERC error code" ); + wxFAIL_MSG( wxS( "Unknown ERC error code" ) ); return nullptr; } diff --git a/eeschema/erc_settings.cpp b/eeschema/erc_settings.cpp index 0d8a2de475..15e5ff0038 100644 --- a/eeschema/erc_settings.cpp +++ b/eeschema/erc_settings.cpp @@ -253,7 +253,7 @@ SEVERITY ERC_SETTINGS::GetSeverity( int aErrorCode ) const } wxCHECK_MSG( m_ERCSeverities.count( aErrorCode ), RPT_SEVERITY_IGNORE, - "Missing severity from map in ERC_SETTINGS!" ); + wxS( "Missing severity from map in ERC_SETTINGS!" ) ); return m_ERCSeverities.at( aErrorCode ); } diff --git a/eeschema/fields_grid_table.cpp b/eeschema/fields_grid_table.cpp index 1bfdca9ce3..f269805f88 100644 --- a/eeschema/fields_grid_table.cpp +++ b/eeschema/fields_grid_table.cpp @@ -565,7 +565,7 @@ wxString FIELDS_GRID_TABLE::GetValue( int aRow, int aCol ) } else { - wxFAIL_MSG( "Unhandled field owner type." ); + wxFAIL_MSG( wxS( "Unhandled field owner type." ) ); return field.GetName( false ); } @@ -913,11 +913,11 @@ wxString FIELDS_GRID_TABLE::StringFromBool( bool aValue ) const template bool FIELDS_GRID_TABLE::BoolFromString( wxString aValue ) const { - if( aValue == "1" ) + if( aValue == wxS( "1" ) ) { return true; } - else if( aValue == "0" ) + else if( aValue == wxS( "0" ) ) { return false; } diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 72abc0a92f..4ac74d1417 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -613,10 +613,10 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent ) SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin( SCH_IO_MGR::FindPlugin( loader.second ) ); wxCHECK( plugin, /*void*/ ); - allWildcards += "*." + formatWildcardExt( plugin->GetFileExtension() ) + ";"; + allWildcards += wxS( "*." ) + formatWildcardExt( plugin->GetFileExtension() ) + wxS( ";" ); } - fileFilters = _( "All supported formats|" ) + allWildcards + "|" + fileFilters; + fileFilters = _( "All supported formats|" ) + allWildcards + wxS( "|" ) + fileFilters; wxFileDialog dlg( this, _( "Import Schematic" ), path, wxEmptyString, fileFilters, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); // TODO diff --git a/eeschema/generate_alias_info.cpp b/eeschema/generate_alias_info.cpp index ceb80e93c9..66f671739f 100644 --- a/eeschema/generate_alias_info.cpp +++ b/eeschema/generate_alias_info.cpp @@ -25,24 +25,24 @@ #include #include -static const wxString DescriptionFormat = +static const wxString DescriptionFormat = wxS( "__NAME__" "__ALIASOF__" "__DESC__" "__KEY__" "
" "__FIELDS__" - "
"; + "" ); -static const wxString AliasOfFormat = "
" + _( "Derived from" ) + " %s (%s)"; -static const wxString DescFormat = "
%s"; -static const wxString KeywordsFormat = "
" + _( "Keywords" ) + ": %s"; -static const wxString FieldFormat = +static const wxString AliasOfFormat = wxS( "
" ) + _( "Derived from" ) + wxS( " %s (%s)" ); +static const wxString DescFormat = wxS( "
%s" ); +static const wxString KeywordsFormat = wxS( "
" ) + _( "Keywords" ) + wxS( ": %s" ); +static const wxString FieldFormat = wxS( "" " __NAME__" " __VALUE__" - ""; -static const wxString DatasheetLinkFormat = "__TEXT__"; + "" ); +static const wxString DatasheetLinkFormat = wxS( "__TEXT__" ); class FOOTPRINT_INFO_GENERATOR @@ -106,7 +106,7 @@ public: protected: void SetHtmlName() { - m_html.Replace( "__NAME__", EscapeHTML( UnescapeString( m_symbol->GetName() ) ) ); + m_html.Replace( wxS( "__NAME__" ), EscapeHTML( UnescapeString( m_symbol->GetName() ) ) ); } @@ -119,7 +119,7 @@ protected: else { wxString root_name = _( "Unknown" ); - wxString root_desc = ""; + wxString root_desc = wxS( "" ); std::shared_ptr< LIB_SYMBOL > parent = m_symbol->GetParent().lock(); @@ -129,7 +129,7 @@ protected: root_desc = parent->GetDescription(); } - m_html.Replace( "__ALIASOF__", wxString::Format( AliasOfFormat, + m_html.Replace( wxS( "__ALIASOF__" ), wxString::Format( AliasOfFormat, EscapeHTML( UnescapeString( root_name ) ), EscapeHTML( root_desc ) ) ); } @@ -140,7 +140,7 @@ protected: { wxString raw_desc = m_symbol->GetDescription(); - m_html.Replace( "__DESC__", wxString::Format( DescFormat, EscapeHTML( raw_desc ) ) ); + m_html.Replace( wxS( "__DESC__" ), wxString::Format( DescFormat, EscapeHTML( raw_desc ) ) ); } @@ -149,9 +149,9 @@ protected: wxString keywords = m_symbol->GetKeyWords(); if( keywords.empty() ) - m_html.Replace( "__KEY__", wxEmptyString ); + m_html.Replace( wxS( "__KEY__" ), wxEmptyString ); else - m_html.Replace( "__KEY__", wxString::Format( KeywordsFormat, EscapeHTML( keywords ) ) ); + m_html.Replace( wxS( "__KEY__" ), wxString::Format( KeywordsFormat, EscapeHTML( keywords ) ) ); } @@ -161,7 +161,7 @@ protected: wxString text = aField.GetFullText( m_unit > 0 ? m_unit : 1 ); wxString fieldhtml = FieldFormat; - fieldhtml.Replace( "__NAME__", EscapeHTML( name ) ); + fieldhtml.Replace( wxS( "__NAME__" ), EscapeHTML( name ) ); switch( aField.GetId() ) { @@ -170,19 +170,19 @@ protected: if( text.IsEmpty() || text == wxT( "~" ) ) { - fieldhtml.Replace( "__VALUE__", text ); + fieldhtml.Replace( wxS( "__VALUE__" ), text ); } else { wxString datasheetlink = DatasheetLinkFormat; - datasheetlink.Replace( "__HREF__", EscapeHTML( text ) ); + datasheetlink.Replace( wxS( "__HREF__" ), EscapeHTML( text ) ); if( text.Length() > 75 ) text = text.Left( 72 ) + wxT( "..." ); - datasheetlink.Replace( "__TEXT__", EscapeHTML( text ) ); + datasheetlink.Replace( wxS( "__TEXT__" ), EscapeHTML( text ) ); - fieldhtml.Replace( "__VALUE__", datasheetlink ); + fieldhtml.Replace( wxS( "__VALUE__" ), datasheetlink ); } break; @@ -192,7 +192,7 @@ protected: return wxEmptyString; default: - fieldhtml.Replace( "__VALUE__", EscapeHTML( text ) ); + fieldhtml.Replace( wxS( "__VALUE__" ), EscapeHTML( text ) ); } return fieldhtml; @@ -230,7 +230,7 @@ protected: } } - m_html.Replace( "__FIELDS__", fieldtable ); + m_html.Replace( wxS( "__FIELDS__" ), fieldtable ); } }; diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index 379ff5e015..2152164bed 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -496,7 +496,7 @@ void LIB_FIELD::SetName( const wxString& aName ) // Mandatory field names are fixed. if( IsMandatory() ) { - wxFAIL_MSG( "trying to set a MANDATORY_FIELD's name\n" ); + wxFAIL_MSG( wxS( "trying to set a MANDATORY_FIELD's name\n" ) ); return; } diff --git a/eeschema/lib_symbol.cpp b/eeschema/lib_symbol.cpp index ef24089b22..5e240532f8 100644 --- a/eeschema/lib_symbol.cpp +++ b/eeschema/lib_symbol.cpp @@ -1204,7 +1204,7 @@ wxString LIB_SYMBOL::GetPrefix() { wxString refDesignator = GetFieldById( REFERENCE_FIELD )->GetText(); - refDesignator.Replace( "~", " " ); + refDesignator.Replace( wxS( "~" ), wxS( " " ) ); wxString prefix = refDesignator; diff --git a/eeschema/libarch.cpp b/eeschema/libarch.cpp index 04483ee6ff..bb7d571796 100644 --- a/eeschema/libarch.cpp +++ b/eeschema/libarch.cpp @@ -48,7 +48,7 @@ bool SCH_EDIT_FRAME::CreateArchiveLibraryCacheFile( bool aUseCurrentSheetFilenam else fn = Schematic().RootScreen()->GetFileName(); - fn.SetName( fn.GetName() + "-cache" ); + fn.SetName( fn.GetName() + wxS( "-cache" ) ); fn.SetExt( LegacySymbolLibFileExtension ); bool success = CreateArchiveLibrary( fn.GetFullPath() ); @@ -131,7 +131,7 @@ bool SCH_EDIT_FRAME::CreateArchiveLibrary( const wxString& aFileName ) if( errorMsg.empty() ) errorMsg += tmp; else - errorMsg += "\n" + tmp; + errorMsg += wxS( "\n" ) + tmp; } } } diff --git a/eeschema/pin_numbers.cpp b/eeschema/pin_numbers.cpp index c568331a4d..f139a304c2 100644 --- a/eeschema/pin_numbers.cpp +++ b/eeschema/pin_numbers.cpp @@ -148,20 +148,20 @@ int PIN_NUMBERS::Compare( const wxString& lhs, const wxString& rhs ) if( symbol2.empty() ) return 2; - bool sym1_isnumeric = symbol1.find_first_of( "0123456789" ) != wxString::npos; - bool sym2_isnumeric = symbol2.find_first_of( "0123456789" ) != wxString::npos; + bool sym1_isnumeric = symbol1.find_first_of( wxS( "0123456789" ) ) != wxString::npos; + bool sym2_isnumeric = symbol2.find_first_of( wxS( "0123456789" ) ) != wxString::npos; if( sym1_isnumeric ) { if( sym2_isnumeric ) { // numeric comparison - wxString::size_type v1 = symbol1.find_first_of( "vV" ); + wxString::size_type v1 = symbol1.find_first_of( wxS( "vV" ) ); if( v1 != wxString::npos ) symbol1[v1] = '.'; - wxString::size_type v2 = symbol2.find_first_of( "vV" ); + wxString::size_type v2 = symbol2.find_first_of( wxS( "vV" ) ); if( v2 != wxString::npos ) symbol2[v2] = '.'; diff --git a/eeschema/project_rescue.cpp b/eeschema/project_rescue.cpp index 3fb84129b5..b64cb3e421 100644 --- a/eeschema/project_rescue.cpp +++ b/eeschema/project_rescue.cpp @@ -325,7 +325,7 @@ bool RESCUE_CACHE_CANDIDATE::PerformAction( RESCUER* aRescuer ) { LIB_SYMBOL* tmp = ( m_cache_candidate ) ? m_cache_candidate : m_lib_candidate; - wxCHECK_MSG( tmp, false, "Both cache and library symbols undefined." ); + wxCHECK_MSG( tmp, false, wxS( "Both cache and library symbols undefined." ) ); std::unique_ptr new_symbol = tmp->Flatten(); new_symbol->SetName( m_new_name ); @@ -455,7 +455,7 @@ void RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues( // library. wxString libNickname = GetRescueLibraryFileName( aRescuer.Schematic() ).GetName(); - LIB_ID new_id( libNickname, new_name + "-" + symbol_id.GetLibNickname().wx_str() ); + LIB_ID new_id( libNickname, new_name + wxS( "-" ) + symbol_id.GetLibNickname().wx_str() ); RESCUE_SYMBOL_LIB_TABLE_CANDIDATE candidate( symbol_id, new_id, cache_match, lib_match, eachSymbol->GetUnit(), @@ -504,7 +504,7 @@ bool RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction( RESCUER* aRescuer ) { LIB_SYMBOL* tmp = ( m_cache_candidate ) ? m_cache_candidate : m_lib_candidate; - wxCHECK_MSG( tmp, false, "Both cache and library symbols undefined." ); + wxCHECK_MSG( tmp, false, wxS( "Both cache and library symbols undefined." ) ); std::unique_ptr new_symbol = tmp->Flatten(); new_symbol->SetLibId( m_new_id ); @@ -781,7 +781,7 @@ bool LEGACY_RESCUER::WriteRescueLibrary( wxWindow *aParent ) void LEGACY_RESCUER::AddSymbol( LIB_SYMBOL* aNewSymbol ) { - wxCHECK_RET( aNewSymbol, "Invalid LIB_SYMBOL pointer." ); + wxCHECK_RET( aNewSymbol, wxS( "Invalid LIB_SYMBOL pointer." ) ); aNewSymbol->SetLib( m_rescue_lib.get() ); m_rescue_lib->AddSymbol( aNewSymbol ); @@ -870,7 +870,7 @@ bool SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary( wxWindow *aParent ) // it to the table. if( !row || ( SCH_IO_MGR::EnumFromStr( row->GetType() ) == SCH_IO_MGR::SCH_LEGACY ) ) { - wxString uri = "${KIPRJMOD}/" + fn.GetFullName(); + wxString uri = wxS( "${KIPRJMOD}/" ) + fn.GetFullName(); wxString libNickname = fn.GetName(); row = new SYMBOL_LIB_TABLE_ROW( libNickname, uri, wxT( "KiCad" ) ); @@ -905,7 +905,7 @@ bool SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary( wxWindow *aParent ) void SYMBOL_LIB_TABLE_RESCUER::AddSymbol( LIB_SYMBOL* aNewSymbol ) { - wxCHECK_RET( aNewSymbol, "Invalid LIB_SYMBOL pointer." ); + wxCHECK_RET( aNewSymbol, wxS( "Invalid LIB_SYMBOL pointer." ) ); m_rescueLibSymbols.emplace_back( std::make_unique( *aNewSymbol ) ); } diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 84745800b7..3bd0272c21 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -53,7 +53,7 @@ LIB_SYMBOL* SchGetLibSymbol( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable, SYMBOL_LIB* aCacheLib, wxWindow* aParent, bool aShowErrorMsg ) { - wxCHECK_MSG( aLibTable, nullptr, "Invalid symbol library table." ); + wxCHECK_MSG( aLibTable, nullptr, wxS( "Invalid symbol library table." ) ); LIB_SYMBOL* symbol = nullptr; @@ -63,7 +63,7 @@ LIB_SYMBOL* SchGetLibSymbol( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable, if( !symbol && aCacheLib ) { - wxCHECK_MSG( aCacheLib->IsCache(), nullptr, "Invalid cache library." ); + wxCHECK_MSG( aCacheLib->IsCache(), nullptr, wxS( "Invalid cache library." ) ); wxString cacheName = aLibId.GetLibNickname().wx_str(); cacheName += "_" + aLibId.GetLibItemName(); @@ -187,12 +187,12 @@ void SCH_BASE_FRAME::UpdateStatusBar() VECTOR2D cursorPos = GetCanvas()->GetViewControls()->GetCursorPosition(); VECTOR2D d = cursorPos - screen->m_LocalOrigin; - line.Printf( "X %s Y %s", + line.Printf( wxS( "X %s Y %s" ), MessageTextFromValue( cursorPos.x, false ), MessageTextFromValue( cursorPos.y, false ) ); SetStatusText( line, 2 ); - line.Printf( "dx %s dy %s dist %s", + line.Printf( wxS( "dx %s dy %s dist %s" ), MessageTextFromValue( d.x, false ), MessageTextFromValue( d.y, false ), MessageTextFromValue( hypot( d.x, d.y ), false ) ); diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index dc12346ad6..37a4221f02 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -87,7 +87,7 @@ SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY( const VECTOR2I& pos, int aQuadrant ) : case 2: m_size.x *= 1; m_size.y *= 1; break; case 3: m_size.x *= -1; m_size.y *= 1; break; case 4: m_size.x *= -1; m_size.y *= -1; break; - default: wxFAIL_MSG( "SCH_BUS_WIRE_ENTRY ctor: unexpected quadrant" ); + default: wxFAIL_MSG( wxS( "SCH_BUS_WIRE_ENTRY ctor: unexpected quadrant" ) ); } m_layer = LAYER_WIRE; diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index 34c419c519..1e898f4b6c 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -441,7 +441,7 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( std::vector& aList ) { UNITS_PROVIDER unitsProvider( schIUScale, EDA_UNITS::MILLIMETRES ); - msg.Printf( "%s at %p", driver->GetItemDescription( &unitsProvider ), driver ); + msg.Printf( wxS( "%s at %p" ), driver->GetItemDescription( &unitsProvider ), driver ); aList.emplace_back( wxT( "Connection Source" ), msg ); } #endif diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 950f0c4ab1..1a74b7f5ac 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -169,10 +169,10 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : CreateInfoBar(); // Rows; layers 4 - 6 - m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ) + m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) ) .Top().Layer( 6 ) ); - m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ) + m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( wxS( "MsgPanel" ) ) .Bottom().Layer( 6 ) ); // Columns; layers 1 - 3 @@ -186,14 +186,14 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : .BestSize( 200, 200 ) .FloatingSize( 200, 200 ) .Show( false ) ); - m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ) + m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( wxS( "OptToolbar" ) ) .Left().Layer( 2 ) ); - m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ) + m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( wxS( "ToolsToolbar" ) ) .Right().Layer( 2 ) ); // Center - m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ) + m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) ) .Center() ); FinishAUIInitialization(); @@ -943,7 +943,7 @@ void SCH_EDIT_FRAME::OnModify() GetCanvas()->Refresh(); UpdateHierarchyNavigator(); - if( !GetTitle().StartsWith( "*" ) ) + if( !GetTitle().StartsWith( wxS( "*" ) ) ) updateTitle(); } @@ -1120,7 +1120,7 @@ void SCH_EDIT_FRAME::NewProject() } // OpenProjectFiles() requires absolute - wxASSERT_MSG( create_me.IsAbsolute(), "wxFileDialog returned non-absolute path" ); + wxASSERT_MSG( create_me.IsAbsolute(), wxS( "wxFileDialog returned non-absolute path" ) ); OpenProjectFiles( std::vector( 1, create_me.GetFullPath() ), KICTL_CREATE ); m_mruPath = create_me.GetPath(); @@ -1132,8 +1132,8 @@ void SCH_EDIT_FRAME::LoadProject() { wxString pro_dir = m_mruPath; wxString wildcards = AllSchematicFilesWildcard() - + "|" + KiCadSchematicFileWildcard() - + "|" + LegacySchematicFileWildcard(); + + wxS( "|" ) + KiCadSchematicFileWildcard() + + wxS( "|" ) + LegacySchematicFileWildcard(); wxFileDialog dlg( this, _( "Open Schematic" ), pro_dir, wxEmptyString, wildcards, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); diff --git a/eeschema/sch_junction.cpp b/eeschema/sch_junction.cpp index a0dc8a55a4..6ac0fe1344 100644 --- a/eeschema/sch_junction.cpp +++ b/eeschema/sch_junction.cpp @@ -160,8 +160,8 @@ void SCH_JUNCTION::Show( int nestLevel, std::ostream& os ) const // XML output: wxString s = GetClass(); - NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str() << m_pos << ", " << m_diameter - << "/>\n"; + NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str() << m_pos << wxS( ", " ) << m_diameter + << wxS( "/>\n" ); } #endif diff --git a/eeschema/sch_label.cpp b/eeschema/sch_label.cpp index 7b52eac483..4c3acc3f5b 100644 --- a/eeschema/sch_label.cpp +++ b/eeschema/sch_label.cpp @@ -86,7 +86,7 @@ bool IncrementLabelMember( wxString& name, int aIncrement ) { name.Remove( ii + 1 ); //write out a format string with correct number of leading zeroes - outputFormat.Printf( "%%0%dld", dCount ); + outputFormat.Printf( wxS( "%%0%dld" ), dCount ); //write out the number using the format string outputNumber.Printf( outputFormat, number ); name << outputNumber << suffix; diff --git a/eeschema/schematic.cpp b/eeschema/schematic.cpp index b513d75901..6c5f2036bc 100644 --- a/eeschema/schematic.cpp +++ b/eeschema/schematic.cpp @@ -105,7 +105,7 @@ void SCHEMATIC::SetProject( PROJECT* aPrj ) void SCHEMATIC::SetRoot( SCH_SHEET* aRootSheet ) { - wxCHECK_RET( aRootSheet, "Call to SetRoot with null SCH_SHEET!" ); + wxCHECK_RET( aRootSheet, wxS( "Call to SetRoot with null SCH_SHEET!" ) ); m_rootSheet = aRootSheet; @@ -273,7 +273,7 @@ bool SCHEMATIC::ResolveCrossReference( wxString* token, int aDepth ) const if( refSymbol->ResolveTextVar( &remainder, aDepth + 1 ) ) *token = remainder; else - *token = refSymbol->GetRef( &sheetPath, true ) + ":" + remainder; + *token = refSymbol->GetRef( &sheetPath, true ) + wxS( ":" ) + remainder; return true; // Cross-reference is resolved whether or not the actual textvar was } @@ -368,13 +368,13 @@ wxString SCHEMATIC::ConvertRefsToKIIDs( const wxString& aSource ) const if( ref == refSymbol->GetRef( &references[ jj ].GetSheetPath(), true ) ) { - token = refSymbol->m_Uuid.AsString() + ":" + remainder; + token = refSymbol->m_Uuid.AsString() + wxS( ":" ) + remainder; break; } } } - newbuf.append( "${" + token + "}" ); + newbuf.append( wxS( "${" ) + token + wxS( "}" ) ); } else { @@ -421,11 +421,11 @@ wxString SCHEMATIC::ConvertKIIDsToRefs( const wxString& aSource ) const if( refItem && refItem->Type() == SCH_SYMBOL_T ) { SCH_SYMBOL* refSymbol = static_cast( refItem ); - token = refSymbol->GetRef( &refSheetPath, true ) + ":" + remainder; + token = refSymbol->GetRef( &refSheetPath, true ) + wxS( ":" ) + remainder; } } - newbuf.append( "${" + token + "}" ); + newbuf.append( wxS( "${" ) + token + wxS( "}" ) ); } else {