diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index 353f478752..5e2761d003 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -517,8 +517,7 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings() if( !fullFileName.IsEmpty() && !wxFileExists( fullFileName ) ) { wxString msg; - msg.Printf( _( "Page layout description file \"%s\" not found." ), - GetChars( fullFileName ) ); + msg.Printf( _( "Page layout description file \"%s\" not found." ), fullFileName ); wxMessageBox( msg ); return false; } @@ -902,7 +901,7 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event ) "Do you want to use the relative path:\n" "\"%s\"\n" "instead of\n" - "\"%s\"?" ), GetChars( shortFileName ), GetChars( fileName ) ); + "\"%s\"?" ), shortFileName, fileName ); if( !IsOK( this, msg ) ) shortFileName = fileName; diff --git a/common/dsnlexer.cpp b/common/dsnlexer.cpp index 6bdb2e6ee5..7934f8e91a 100644 --- a/common/dsnlexer.cpp +++ b/common/dsnlexer.cpp @@ -321,7 +321,7 @@ bool DSNLEXER::IsSymbol( int aTok ) void DSNLEXER::Expecting( int aTok ) { wxString errText = wxString::Format( - _( "Expecting %s" ), GetChars( GetTokenString( aTok ) ) ); + _( "Expecting %s" ), GetTokenString( aTok ) ); THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); } @@ -329,7 +329,7 @@ void DSNLEXER::Expecting( int aTok ) void DSNLEXER::Expecting( const char* text ) { wxString errText = wxString::Format( - _( "Expecting '%s'" ), GetChars( wxString::FromUTF8( text ) ) ); + _( "Expecting '%s'" ), wxString::FromUTF8( text ) ); THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); } @@ -337,7 +337,7 @@ void DSNLEXER::Expecting( const char* text ) void DSNLEXER::Unexpected( int aTok ) { wxString errText = wxString::Format( - _( "Unexpected %s" ), GetChars( GetTokenString( aTok ) ) ); + _( "Unexpected %s" ), GetTokenString( aTok ) ); THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); } @@ -353,7 +353,7 @@ void DSNLEXER::Duplicate( int aTok ) void DSNLEXER::Unexpected( const char* text ) { wxString errText = wxString::Format( - _( "Unexpected '%s'" ), GetChars( wxString::FromUTF8( text ) ) ); + _( "Unexpected '%s'" ), wxString::FromUTF8( text ) ); THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); } diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index b8bdfeb559..4531fe6634 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -820,17 +820,17 @@ bool EDA_BASE_FRAME::IsWritable( const wxFileName& aFileName ) if( fn.IsDir() && !fn.IsDirWritable() ) { msg.Printf( _( "You do not have write permissions to folder \"%s\"." ), - GetChars( fn.GetPath() ) ); + fn.GetPath() ); } else if( !fn.FileExists() && !fn.IsDirWritable() ) { msg.Printf( _( "You do not have write permissions to save file \"%s\" to folder \"%s\"." ), - GetChars( fn.GetFullName() ), GetChars( fn.GetPath() ) ); + fn.GetFullName(), fn.GetPath() ); } else if( fn.FileExists() && !fn.IsFileWritable() ) { msg.Printf( _( "You do not have write permissions to save file \"%s\"." ), - GetChars( fn.GetFullPath() ) ); + fn.GetFullPath() ); } if( !msg.IsEmpty() ) @@ -863,7 +863,7 @@ void EDA_BASE_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName ) "It appears that the last time you were editing the file\n" "\"%s\"\n" "it was not saved properly. Do you wish to restore the last saved edits you made?" ), - GetChars( aFileName.GetFullName() ) + aFileName.GetFullName() ); int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this ); diff --git a/common/eda_doc.cpp b/common/eda_doc.cpp index dab3edb615..aeca824911 100644 --- a/common/eda_doc.cpp +++ b/common/eda_doc.cpp @@ -153,7 +153,7 @@ bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT if( !wxFileExists( fullfilename ) ) { - msg.Printf( _( "Doc File \"%s\" not found" ), GetChars( docname ) ); + msg.Printf( _( "Doc File \"%s\" not found" ), docname ); DisplayError( aParent, msg ); return false; } @@ -196,7 +196,7 @@ bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT if( !success ) { - msg.Printf( _( "Unknown MIME type for doc file \"%s\"" ), GetChars( fullfilename ) ); + msg.Printf( _( "Unknown MIME type for doc file \"%s\"" ), fullfilename ); DisplayError( aParent, msg ); } diff --git a/common/eda_item.cpp b/common/eda_item.cpp index 3d09021083..1b49c9cb3b 100644 --- a/common/eda_item.cpp +++ b/common/eda_item.cpp @@ -180,8 +180,7 @@ bool EDA_ITEM::Replace( wxFindReplaceData& aSearchData, wxString& aText ) suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) ); wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ), - GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ), - GetChars( suffix ) ); + aText, prefix, aSearchData.GetReplaceString(), suffix ); aText = prefix + aSearchData.GetReplaceString() + suffix; @@ -192,7 +191,7 @@ bool EDA_ITEM::Replace( wxFindReplaceData& aSearchData, wxString& aText ) bool EDA_ITEM::operator<( const EDA_ITEM& aItem ) const { wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ), - GetChars( GetClass() ) ) ); + GetClass() ) ); return false; } diff --git a/common/gestfich.cpp b/common/gestfich.cpp index d1b7cd02d1..a3a9f7730f 100644 --- a/common/gestfich.cpp +++ b/common/gestfich.cpp @@ -184,7 +184,7 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& para #endif wxString msg; - msg.Printf( _( "Command \"%s\" could not found" ), GetChars( fullFileName ) ); + msg.Printf( _( "Command \"%s\" could not found" ), fullFileName ); DisplayError( frame, msg, 20 ); return -1; } diff --git a/common/html_messagebox.cpp b/common/html_messagebox.cpp index 521a045889..d6b396f933 100644 --- a/common/html_messagebox.cpp +++ b/common/html_messagebox.cpp @@ -107,7 +107,7 @@ void HTML_MESSAGE_BOX::ListSet( const wxArrayString& aList ) void HTML_MESSAGE_BOX::MessageSet( const wxString& message ) { wxString message_value = wxString::Format( - wxT( "%s
" ), GetChars( message ) ); + wxT( "%s
" ), message ); m_htmlWindow->AppendToPage( message_value ); } diff --git a/common/libeval_compiler/libeval_compiler.cpp b/common/libeval_compiler/libeval_compiler.cpp index d8b97f6613..bfcd3392d3 100644 --- a/common/libeval_compiler/libeval_compiler.cpp +++ b/common/libeval_compiler/libeval_compiler.cpp @@ -142,7 +142,7 @@ wxString UOP::Format() const else if( m_value->GetType() == VT_NUMERIC ) str = wxString::Format( "PUSH NUM [%.10f]", m_value->AsDouble() ); else - str = wxString::Format( "PUSH STR [%ls]", GetChars( m_value->AsString() ) ); + str = wxString::Format( "PUSH STR [%ls]", m_value->AsString() ); } break; diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index b39e6b1dcd..3548d954b3 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -211,10 +211,8 @@ bool PGM_BASE::InitPgm() if( m_pgm_checker->IsAnotherRunning() ) { - wxString quiz = wxString::Format( - _( "%s is already running. Continue?" ), - GetChars( pgm_name.GetName() ) - ); + wxString quiz = + wxString::Format( _( "%s is already running. Continue?" ), pgm_name.GetName() ); if( !IsOK( NULL, quiz ) ) return false; diff --git a/common/single_top.cpp b/common/single_top.cpp index 21db06c7a1..40ad56d7b6 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -172,12 +172,11 @@ struct APP_SINGLE_TOP : public wxApp catch( const std::exception& e ) { wxLogError( wxT( "Unhandled exception class: %s what: %s" ), - GetChars( FROM_UTF8( typeid(e).name() )), - GetChars( FROM_UTF8( e.what() ) ) ); + FROM_UTF8( typeid( e ).name() ), FROM_UTF8( e.what() ) ); } catch( const IO_ERROR& ioe ) { - wxLogError( GetChars( ioe.What() ) ); + wxLogError( ioe.What() ); } catch(...) { @@ -209,12 +208,11 @@ struct APP_SINGLE_TOP : public wxApp catch( const std::exception& e ) { wxLogError( wxT( "Unhandled exception class: %s what: %s" ), - GetChars( FROM_UTF8( typeid(e).name() )), - GetChars( FROM_UTF8( e.what() ) ) ); + FROM_UTF8( typeid( e ).name() ), FROM_UTF8( e.what() ) ); } catch( const IO_ERROR& ioe ) { - wxLogError( GetChars( ioe.What() ) ); + wxLogError( ioe.What() ); } catch(...) { diff --git a/cvpcb/auto_associate.cpp b/cvpcb/auto_associate.cpp index 8872a37c76..5892c0db85 100644 --- a/cvpcb/auto_associate.cpp +++ b/cvpcb/auto_associate.cpp @@ -103,7 +103,7 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wx { error_msg.Printf( _( "Equivalence file \"%s\" could not be found in the " "default search paths." ), - GetChars( fn.GetFullName() ) ); + fn.GetFullName() ); if( ! aErrorMessages->IsEmpty() ) *aErrorMessages << wxT("\n\n"); @@ -122,7 +122,7 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wx if( aErrorMessages ) { - error_msg.Printf( _( "Error opening equivalence file \"%s\"." ), GetChars( tmp ) ); + error_msg.Printf( _( "Error opening equivalence file \"%s\"." ), tmp ); if( ! aErrorMessages->IsEmpty() ) *aErrorMessages << wxT("\n\n"); @@ -258,8 +258,7 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching() { msg.Printf( _( "Component %s: footprint %s not found in any of the project " "footprint libraries." ), - GetChars( component->GetReference() ), - GetChars( equivItem.m_FootprintFPID ) ); + component->GetReference(), equivItem.m_FootprintFPID ); if( ! error_msg.IsEmpty() ) error_msg << wxT("\n\n"); diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index 5217dc9085..50b963a0de 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -721,7 +721,7 @@ void CVPCB_MAINFRAME::DisplayStatus() if( filters.IsEmpty() ) msg = _( "No filtering" ); else - msg.Printf( _( "Filtered by %s" ), GetChars( filters ) ); + msg.Printf( _( "Filtered by %s" ), filters ); msg << wxT( ": " ) << m_footprintListBox->GetCount(); diff --git a/cvpcb/dialogs/dialog_config_equfiles.cpp b/cvpcb/dialogs/dialog_config_equfiles.cpp index 052314effe..e1f1a65c33 100644 --- a/cvpcb/dialogs/dialog_config_equfiles.cpp +++ b/cvpcb/dialogs/dialog_config_equfiles.cpp @@ -45,9 +45,8 @@ DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES( CVPCB_MAINFRAME* aParent ) : { m_Parent = aParent; - PROJECT& prj = Prj(); - SetTitle( wxString::Format( _( "Project file: \"%s\"" ), - GetChars( prj.GetProjectFullName() ) ) ); + PROJECT& prj = Prj(); + SetTitle( wxString::Format( _( "Project file: \"%s\"" ), prj.GetProjectFullName() ) ); Init( ); @@ -270,9 +269,8 @@ void DIALOG_CONFIG_EQUFILES::OnAddFiles( wxCommandEvent& event ) if( fn.MakeRelativeTo( libpath ) ) { equFilename.Printf( wxT( "${%s}%c%s" ), - GetChars( m_gridEnvVars->GetCellValue( wxGridCellCoords( row, 0 ) ) ), - fn.GetPathSeparator(), - GetChars( fn.GetFullPath() ) ); + m_gridEnvVars->GetCellValue( wxGridCellCoords( row, 0 ) ), + fn.GetPathSeparator(), fn.GetFullPath() ); break; } } diff --git a/cvpcb/readwrite_dlgs.cpp b/cvpcb/readwrite_dlgs.cpp index 2a61431a4c..dc8f1c778f 100644 --- a/cvpcb/readwrite_dlgs.cpp +++ b/cvpcb/readwrite_dlgs.cpp @@ -145,16 +145,16 @@ bool CVPCB_MAINFRAME::ReadNetListAndFpFiles( const std::string& aNetlist ) case 1: msg += wxString::Format( _( "Component \"%s\" footprint \"%s\" was not found in any library.\n" ), - GetChars( component->GetReference() ), - GetChars( component->GetFPID().GetLibItemName() ) + component->GetReference(), + component->GetFPID().GetLibItemName().wx_str() ); break; case 2: msg += wxString::Format( _( "Component \"%s\" footprint \"%s\" was found in multiple libraries.\n" ), - GetChars( component->GetReference() ), - GetChars( component->GetFPID().GetLibItemName() ) + component->GetReference(), + component->GetFPID().GetLibItemName().wx_str() ); break; } @@ -263,9 +263,9 @@ bool CVPCB_MAINFRAME::ReadNetListAndFpFiles( const std::string& aNetlist ) COMPONENT* component = m_netlist.GetComponent( i ); msg.Printf( CMP_FORMAT, m_compListBox->GetCount() + 1, - GetChars( component->GetReference() ), - GetChars( component->GetValue() ), - GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) ); + component->GetReference(), + component->GetValue(), + FROM_UTF8( component->GetFPID().Format().c_str() ) ); m_compListBox->AppendLine( msg ); } diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 370326c664..66a0b546fa 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -554,7 +554,7 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress ) { wxString msg; msg.Printf( _( "Symbol library \"%s\" failed to load. Error:\n %s" ), - GetChars( filename ), GetChars( ioe.What() ) ); + filename, ioe.What() ); wxLogError( msg ); } @@ -576,11 +576,9 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress ) } catch( const IO_ERROR& ioe ) { - wxString msg = wxString::Format( _( - "Symbol library \"%s\" failed to load.\nError: %s" ), - GetChars( cache_name ), - GetChars( ioe.What() ) - ); + wxString msg = + wxString::Format( _( "Symbol library \"%s\" failed to load.\nError: %s" ), + cache_name, ioe.What() ); THROW_IO_ERROR( msg ); } diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp index ef94d25ba5..87007c34d4 100644 --- a/eeschema/dialogs/dialog_plot_schematic.cpp +++ b/eeschema/dialogs/dialog_plot_schematic.cpp @@ -163,7 +163,7 @@ void DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked( wxCommandEvent& even // Test if making the path relative is possible before asking the user if they want to do it if( relPathTest.MakeRelativeTo( defaultPath ) ) { - msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ), GetChars( defaultPath ) ); + msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ), defaultPath ); wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ), wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT ); diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index ff2cba6b06..f387b9506f 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -490,7 +490,7 @@ void LIB_EDIT_FRAME::RebuildSymbolUnitsList() for( int i = 0; i < m_my_part->GetUnitCount(); i++ ) { wxString sub = LIB_PART::SubReference( i+1, false ); - wxString unit = wxString::Format( _( "Unit %s" ), GetChars( sub ) ); + wxString unit = wxString::Format( _( "Unit %s" ), sub ); m_unitSelectBox->Append( unit ); } } diff --git a/eeschema/libedit/libedit.cpp b/eeschema/libedit/libedit.cpp index fba1cef354..0aac41aa71 100644 --- a/eeschema/libedit/libedit.cpp +++ b/eeschema/libedit/libedit.cpp @@ -677,7 +677,7 @@ void LIB_EDIT_FRAME::DuplicatePart( bool aFromClipboard ) } catch( IO_ERROR& e ) { - wxLogMessage( "Can not paste: %s", GetChars( e.Problem() ) ); + wxLogMessage( "Can not paste: %s", e.Problem() ); return; } } diff --git a/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp b/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp index 3b0a256291..93967ef436 100644 --- a/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp @@ -45,8 +45,7 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig if( ( f = wxFopen( aOutFileName, wxT( "wt" ) ) ) == NULL ) { wxString msg; - msg.Printf( _( "Failed to create file \"%s\"" ), - GetChars( aOutFileName ) ); + msg.Printf( _( "Failed to create file \"%s\"" ), aOutFileName ); DisplayError( NULL, msg ); return false; } @@ -181,12 +180,9 @@ bool NETLIST_EXPORTER_CADSTAR::writeListOfNets( FILE* f ) switch( print_ter ) { case 0: - { - InitNetDescLine.Printf( wxT( "\n%s %s %.4s %s" ), - GetChars( InitNetDesc ), - GetChars( refText ), - GetChars( pinText ), - GetChars( netName ) ); + { + InitNetDescLine.Printf( + wxT( "\n%s %s %.4s %s" ), InitNetDesc, refText, pinText, netName ); } print_ter++; break; diff --git a/eeschema/netlist_exporters/netlist_exporter_orcadpcb2.cpp b/eeschema/netlist_exporters/netlist_exporter_orcadpcb2.cpp index 83824c2af2..fa225b22e3 100644 --- a/eeschema/netlist_exporters/netlist_exporter_orcadpcb2.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_orcadpcb2.cpp @@ -50,8 +50,7 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName, if( ( f = wxFopen( aOutFileName, wxT( "wt" ) ) ) == NULL ) { wxString msg; - msg.Printf( _( "Failed to create file \"%s\"" ), - GetChars( aOutFileName ) ); + msg.Printf( _( "Failed to create file \"%s\"" ), aOutFileName ); DisplayError( NULL, msg ); return false; } diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index 2ad4fc9954..5d62a7b268 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -93,8 +93,8 @@ EDA_ITEM* SCH_BITMAP::Clone() const void SCH_BITMAP::SwapData( SCH_ITEM* aItem ) { wxCHECK_RET( aItem->Type() == SCH_BITMAP_T, - wxString::Format( wxT( "SCH_BITMAP object cannot swap data with %s object." ), - GetChars( aItem->GetClass() ) ) ); + wxString::Format( wxT( "SCH_BITMAP object cannot swap data with %s object." ), + aItem->GetClass() ) ); SCH_BITMAP* item = (SCH_BITMAP*) aItem; std::swap( m_pos, item->m_pos ); diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp index 25a9e1f3d4..e6ea858745 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp @@ -1488,7 +1488,7 @@ void SCH_SEXPR_PARSER::parsePAGE_INFO( PAGE_INFO& aPageInfo ) if( !aPageInfo.SetType( pageType ) ) { wxString err; - err.Printf( _( "Page type \"%s\" is not valid " ), GetChars( FromUTF8() ) ); + err.Printf( _( "Page type \"%s\" is not valid " ), FromUTF8() ); THROW_PARSE_ERROR( err, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); } @@ -2101,7 +2101,7 @@ SCH_COMPONENT* SCH_SEXPR_PARSER::parseSchematicSymbol() { error.Printf( _( "Invalid symbol library ID in\nfile: \"%s\"\nline: %d\n" "offset: %d" ), - GetChars( CurSource() ), CurLineNumber(), CurOffset() ); + CurSource(), CurLineNumber(), CurOffset() ); THROW_IO_ERROR( error ); } diff --git a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp index 5b81c41236..09dbc41af3 100644 --- a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp +++ b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp @@ -806,8 +806,8 @@ void SCH_LEGACY_PLUGIN::loadHeader( LINE_READER& aReader, SCH_SCREEN* aScreen ) if( !line || !strCompare( "Eeschema Schematic File Version", line, &line ) ) { - m_error.Printf( _( "\"%s\" does not appear to be an Eeschema file" ), - GetChars( aScreen->GetFileName() ) ); + m_error.Printf( + _( "\"%s\" does not appear to be an Eeschema file" ), aScreen->GetFileName() ); THROW_IO_ERROR( m_error ); } diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 98a4e4fa09..1c00f628a4 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -250,8 +250,8 @@ bool SCH_SHEET::UsesDefaultStroke() const void SCH_SHEET::SwapData( SCH_ITEM* aItem ) { wxCHECK_RET( aItem->Type() == SCH_SHEET_T, - wxString::Format( wxT( "SCH_SHEET object cannot swap data with %s object." ), - GetChars( aItem->GetClass() ) ) ); + wxString::Format( wxT( "SCH_SHEET object cannot swap data with %s object." ), + aItem->GetClass() ) ); SCH_SHEET* sheet = ( SCH_SHEET* ) aItem; diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp index b5002daec6..9862418c88 100644 --- a/eeschema/sch_sheet_pin.cpp +++ b/eeschema/sch_sheet_pin.cpp @@ -74,8 +74,8 @@ void SCH_SHEET_PIN::Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) void SCH_SHEET_PIN::SwapData( SCH_ITEM* aItem ) { wxCHECK_RET( aItem->Type() == SCH_SHEET_PIN_T, - wxString::Format( wxT( "SCH_SHEET_PIN object cannot swap data with %s object." ), - GetChars( aItem->GetClass() ) ) ); + wxString::Format( wxT( "SCH_SHEET_PIN object cannot swap data with %s object." ), + aItem->GetClass() ) ); SCH_SHEET_PIN* pin = ( SCH_SHEET_PIN* ) aItem; SCH_TEXT::SwapData( (SCH_TEXT*) pin ); diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index cb782960f8..228106a9f1 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -547,7 +547,7 @@ wxString SCH_TEXT::GetShownText( int aDepth ) const wxString SCH_TEXT::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Graphic Text '%s'" ), GetChars( ShortenedShownText() ) ); + return wxString::Format( _( "Graphic Text '%s'" ), ShortenedShownText() ); } diff --git a/eeschema/symbol_lib_table.cpp b/eeschema/symbol_lib_table.cpp index e7f2085919..3b9c7410cb 100644 --- a/eeschema/symbol_lib_table.cpp +++ b/eeschema/symbol_lib_table.cpp @@ -227,7 +227,7 @@ void SYMBOL_LIB_TABLE::Parse( LIB_TABLE_LEXER* in ) wxString msg = wxString::Format( _( "Duplicate library nickname \"%s\" found in symbol library " - "table file line %d" ), GetChars( nickname ), lineNum ); + "table file line %d" ), nickname, lineNum ); if( !errMsg.IsEmpty() ) errMsg << '\n'; @@ -492,8 +492,8 @@ bool SYMBOL_LIB_TABLE::LoadGlobalTable( SYMBOL_LIB_TABLE& aTable ) if( !fn.DirExists() && !fn.Mkdir( 0x777, wxPATH_MKDIR_FULL ) ) { - THROW_IO_ERROR( wxString::Format( _( "Cannot create global library table path \"%s\"." ), - GetChars( fn.GetPath() ) ) ); + THROW_IO_ERROR( wxString::Format( + _( "Cannot create global library table path \"%s\"." ), fn.GetPath() ) ); } // Attempt to copy the default global file table from the KiCad diff --git a/gerbview/files.cpp b/gerbview/files.cpp index 2d8f7473b7..23efccba30 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -525,7 +525,7 @@ bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aR reported_no_more_layer = true; // Report the name of not loaded files: - msg.Printf( MSG_NOT_LOADED, GetChars( entry->GetName() ) ); + msg.Printf( MSG_NOT_LOADED, entry->GetName() ); aReporter->Report( msg, RPT_SEVERITY_ERROR ); } diff --git a/gerbview/gerber_file_image_list.cpp b/gerbview/gerber_file_image_list.cpp index 5fc2b2cea7..d7a3fb2774 100644 --- a/gerbview/gerber_file_image_list.cpp +++ b/gerbview/gerber_file_image_list.cpp @@ -151,25 +151,25 @@ const wxString GERBER_FILE_IMAGE_LIST::GetDisplayName( int aIdx, bool aNameOnly { name.Printf( "%s (%s, %s, %s)", filename.GetData(), - GetChars( gerber->m_FileFunction->GetFileType() ), - GetChars( gerber->m_FileFunction->GetBrdLayerId() ), - GetChars( gerber->m_FileFunction->GetBrdLayerSide() ) ); + gerber->m_FileFunction->GetFileType(), + gerber->m_FileFunction->GetBrdLayerId(), + gerber->m_FileFunction->GetBrdLayerSide() ); } if( gerber->m_FileFunction->IsDrillFile() ) { name.Printf( "%s (%s,%s,%s,%s)", filename.GetData(), - GetChars( gerber->m_FileFunction->GetFileType() ), - GetChars( gerber->m_FileFunction->GetDrillLayerPair() ), - GetChars( gerber->m_FileFunction->GetLPType() ), - GetChars( gerber->m_FileFunction->GetRouteType() ) ); + gerber->m_FileFunction->GetFileType(), + gerber->m_FileFunction->GetDrillLayerPair(), + gerber->m_FileFunction->GetLPType(), + gerber->m_FileFunction->GetRouteType() ); } else { name.Printf( "%s (%s, %s)", filename.GetData(), - GetChars( gerber->m_FileFunction->GetFileType() ), - GetChars( gerber->m_FileFunction->GetBrdLayerId() ) ); + gerber->m_FileFunction->GetFileType(), + gerber->m_FileFunction->GetBrdLayerId() ); } } else diff --git a/gerbview/rs274x.cpp b/gerbview/rs274x.cpp index 4727a1ea5a..da5c2f3aad 100644 --- a/gerbview/rs274x.cpp +++ b/gerbview/rs274x.cpp @@ -1014,7 +1014,7 @@ bool GERBER_FILE_IMAGE::ReadApertureMacro( char *aBuff, unsigned int aBuffSize, else if( !isdigit(*aText) ) // Ill. symbol { msg.Printf( wxT( "RS274X: Aperture Macro \"%s\": ill. symbol, line: \"%s\"" ), - GetChars( am.name ), GetChars( FROM_UTF8( aBuff ) ) ); + am.name, FROM_UTF8( aBuff ) ); AddMessageToList( msg ); primitive_type = AMP_COMMENT; } @@ -1072,7 +1072,7 @@ bool GERBER_FILE_IMAGE::ReadApertureMacro( char *aBuff, unsigned int aBuffSize, default: msg.Printf( wxT( "RS274X: Aperture Macro \"%s\": Invalid primitive id code %d, line %d: \"%s\"" ), - GetChars( am.name ), primitive_type, m_LineNum, GetChars( FROM_UTF8( aBuff ) ) ); + am.name, primitive_type, m_LineNum, FROM_UTF8( aBuff ) ); AddMessageToList( msg ); return false; } diff --git a/gerbview/tools/gerbview_inspection_tool.cpp b/gerbview/tools/gerbview_inspection_tool.cpp index 7d48154f40..02ae4b8ca5 100644 --- a/gerbview/tools/gerbview_inspection_tool.cpp +++ b/gerbview/tools/gerbview_inspection_tool.cpp @@ -127,7 +127,7 @@ int GERBVIEW_INSPECTION_TOOL::ShowDCodes( const TOOL_EVENT& aEvent ) pt_D_code->m_Size.y / scale, units, pt_D_code->m_Size.x / scale, units, D_CODE::ShowApertureType( pt_D_code->m_Shape ), - pt_D_code->m_AperFunction.IsEmpty()? wxT( "none" ) : GetChars( pt_D_code->m_AperFunction ) + pt_D_code->m_AperFunction.IsEmpty()? wxT( "none" ) : pt_D_code->m_AperFunction ); if( !pt_D_code->m_Defined ) @@ -169,8 +169,7 @@ int GERBVIEW_INSPECTION_TOOL::ShowSource( const TOOL_EVENT& aEvent ) if( !fn.FileExists() ) { wxString msg; - msg.Printf( _( "Source file \"%s\" is not available" ), - GetChars( fn.GetFullPath() ) ); + msg.Printf( _( "Source file \"%s\" is not available" ), fn.GetFullPath() ); wxMessageBox( msg ); } else diff --git a/gerbview/tools/gerbview_selection_tool.cpp b/gerbview/tools/gerbview_selection_tool.cpp index f291e17fb1..dc725470fd 100644 --- a/gerbview/tools/gerbview_selection_tool.cpp +++ b/gerbview/tools/gerbview_selection_tool.cpp @@ -71,8 +71,8 @@ private: ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_CMP ) ) { auto menuEntry = Add( GERBVIEW_ACTIONS::highlightComponent ); - menuEntry->SetItemLabel( wxString::Format( _( "Highlight Items of Component \"%s\"" ), - GetChars( net_attr.m_Cmpref ) ) ); + menuEntry->SetItemLabel( wxString::Format( + _( "Highlight Items of Component \"%s\"" ), net_attr.m_Cmpref ) ); addSeparator = true; } @@ -89,8 +89,8 @@ private: if( apertDescr && !apertDescr->m_AperFunction.IsEmpty() ) { auto menuEntry = Add( GERBVIEW_ACTIONS::highlightAttribute ); - menuEntry->SetItemLabel( wxString::Format( _( "Highlight Aperture Type \"%s\"" ), - GetChars( apertDescr->m_AperFunction ) ) ); + menuEntry->SetItemLabel( wxString::Format( + _( "Highlight Aperture Type \"%s\"" ), apertDescr->m_AperFunction ) ); addSeparator = true; } } diff --git a/include/macros.h b/include/macros.h index 7c4b0a2133..8ebf6c7878 100644 --- a/include/macros.h +++ b/include/macros.h @@ -122,30 +122,6 @@ static inline wxString FROM_UTF8( const char* cstring ) return line; } -/** - * Function GetChars - * returns a wxChar* to the actual wxChar* data within a wxString, and is - * helpful for passing strings to wxString::Printf() and wxString::Format(). - * It can also be passed a UTF8 parameter which will be converted to wxString - * by the compiler. - *

- * Example: wxString::Format( wxT( "%s" ), GetChars( UTF( "some text" ) ) ); - *

- * When wxWidgets is properly built for KiCad, a const wxChar* points to either: - *

- * Note that you cannot pass 8 bit strings to wxString::Format() or Printf() so this - * is a useful conversion function to wxChar*, which is needed by wxString::Format(). - * - * @return const wxChar* - a pointer to the UNICODE or UTF16 (on windows) text. - */ -static inline const wxChar* GetChars( const wxString& s ) -{ - return (const wxChar*) s.c_str(); -} - /// # of elements in an array. This implements type-safe compile time checking template constexpr std::size_t arrayDim(T const (&)[N]) noexcept diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index a77b339099..3b712c7e75 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -292,12 +292,11 @@ struct APP_KICAD : public wxApp catch( const std::exception& e ) { wxLogError( wxT( "Unhandled exception class: %s what: %s" ), - GetChars( FROM_UTF8( typeid(e).name() )), - GetChars( FROM_UTF8( e.what() ) ) ); + FROM_UTF8( typeid( e ).name() ), FROM_UTF8( e.what() ) ); } catch( const IO_ERROR& ioe ) { - wxLogError( GetChars( ioe.What() ) ); + wxLogError( ioe.What() ); } catch(...) { diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index b6302ff3bd..a63e5b2b2c 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -651,8 +651,7 @@ void KICAD_MANAGER_FRAME::InstallPreferences( PAGED_DIALOG* aParent, void KICAD_MANAGER_FRAME::PrintPrjInfo() { - wxString msg = wxString::Format( _( "Project name:\n%s\n" ), - GetChars( GetProjectFileName() ) ); + wxString msg = wxString::Format( _( "Project name:\n%s\n" ), GetProjectFileName() ); PrintMsg( msg ); } diff --git a/kicad/tree_project_frame.cpp b/kicad/tree_project_frame.cpp index ab1b3ad44b..6a5a04e718 100644 --- a/kicad/tree_project_frame.cpp +++ b/kicad/tree_project_frame.cpp @@ -248,8 +248,7 @@ void TREE_PROJECT_FRAME::OnCreateNewDirectory( wxCommandEvent& event ) curr_dir += wxFileName::GetPathSeparator(); } - wxString msg = - wxString::Format( _( "Current project directory:\n%s" ), GetChars( prj_dir ) ); + wxString msg = wxString::Format( _( "Current project directory:\n%s" ), prj_dir ); wxString subdir = wxGetTextFromUser( msg, _( "Create New Directory" ), curr_dir ); if( subdir.IsEmpty() ) diff --git a/pagelayout_editor/files.cpp b/pagelayout_editor/files.cpp index ae2e1a6875..34805ed276 100644 --- a/pagelayout_editor/files.cpp +++ b/pagelayout_editor/files.cpp @@ -67,7 +67,7 @@ void PL_EDITOR_FRAME::OnFileHistory( wxCommandEvent& event ) if( LoadPageLayoutDescrFile( filename ) ) { wxString msg; - msg.Printf( _( "File \"%s\" loaded"), GetChars( filename ) ); + msg.Printf( _( "File \"%s\" loaded"), filename ); SetStatusText( msg ); } @@ -125,14 +125,14 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event ) if( ! InsertPageLayoutDescrFile( filename ) ) { - msg.Printf( _( "Unable to load %s file" ), GetChars( filename ) ); + msg.Printf( _( "Unable to load %s file" ), filename ); wxMessageBox( msg ); } else { GetScreen()->SetModify(); HardRedraw(); - msg.Printf( _( "File \"%s\" inserted" ), GetChars( filename ) ); + msg.Printf( _( "File \"%s\" inserted" ), filename ); SetStatusText( msg ); } } @@ -150,13 +150,13 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event ) if( ! LoadPageLayoutDescrFile( filename ) ) { - msg.Printf( _( "Unable to load %s file" ), GetChars( filename ) ); + msg.Printf( _( "Unable to load %s file" ), filename ); wxMessageBox( msg ); } else { OnNewPageLayout(); - msg.Printf( _( "File \"%s\" loaded" ), GetChars( filename ) ); + msg.Printf( _( "File \"%s\" loaded" ), filename ); SetStatusText( msg ); } } @@ -165,12 +165,12 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event ) case wxID_SAVE: if( !SavePageLayoutDescrFile( filename ) ) { - msg.Printf( _( "Unable to write \"%s\"" ), GetChars( filename ) ); + msg.Printf( _( "Unable to write \"%s\"" ), filename ); wxMessageBox( msg ); } else { - msg.Printf( _("File \"%s\" written"), GetChars( filename ) ); + msg.Printf( _("File \"%s\" written"), filename ); SetStatusText( msg ); } break; @@ -195,13 +195,13 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event ) if( !SavePageLayoutDescrFile( filename ) ) { - msg.Printf( _("Unable to create \"%s\""), GetChars( filename ) ); + msg.Printf( _("Unable to create \"%s\""), filename ); wxMessageBox( msg ); } else { - msg.Printf( _("File \"%s\" written"), GetChars( filename ) ); + msg.Printf( _("File \"%s\" written"), filename ); SetStatusText( msg ); if( GetCurrentFileName().IsEmpty() ) diff --git a/pcbnew/build_BOM_from_board.cpp b/pcbnew/build_BOM_from_board.cpp index 337399569e..b3fd3fb7f7 100644 --- a/pcbnew/build_BOM_from_board.cpp +++ b/pcbnew/build_BOM_from_board.cpp @@ -98,7 +98,7 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) if( fp_bom == NULL ) { - msg.Printf( _( "Unable to create file \"%s\"" ), GetChars( fn.GetFullPath() ) ); + msg.Printf( _( "Unable to create file \"%s\"" ), fn.GetFullPath() ); DisplayError( this, msg ); return; } diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index c4dd8b939c..b16f489256 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -776,8 +776,7 @@ void MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetFileName() ) ); wxString defaultPath = fn.GetPathWithSep(); wxString msg; - msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ), GetChars( defaultPath ) ); + msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ), defaultPath ); wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ), wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT ); @@ -371,7 +371,7 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap ) { wxString msg; msg.Printf( _( "Could not write drill and/or map files to folder \"%s\"." ), - GetChars( outputDir.GetPath() ) ); + outputDir.GetPath() ); DisplayError( this, msg ); return; } @@ -445,12 +445,12 @@ void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event ) if( ! success ) { - msg.Printf( _( "** Unable to create %s **\n" ), GetChars( dlg.GetPath() ) ); + msg.Printf( _( "** Unable to create %s **\n" ), dlg.GetPath() ); m_messagesBox->AppendText( msg ); } else { - msg.Printf( _( "Report file %s created\n" ), GetChars( dlg.GetPath() ) ); + msg.Printf( _( "Report file %s created\n" ), dlg.GetPath() ); m_messagesBox->AppendText( msg ); } } diff --git a/pcbnew/dialogs/dialog_netlist.cpp b/pcbnew/dialogs/dialog_netlist.cpp index 95120678d4..dabc222377 100644 --- a/pcbnew/dialogs/dialog_netlist.cpp +++ b/pcbnew/dialogs/dialog_netlist.cpp @@ -236,7 +236,7 @@ void DIALOG_NETLIST::loadNetlist( bool aDryRun ) wxBusyCursor busy; wxString msg; - msg.Printf( _( "Reading netlist file \"%s\".\n" ), GetChars( netlistFileName ) ); + msg.Printf( _( "Reading netlist file \"%s\".\n" ), netlistFileName ); reporter.ReportHead( msg, RPT_SEVERITY_INFO ); if( m_matchByTimestamp->GetSelection() == 1 ) diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 87d9f05b1a..ca1bba4838 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -387,8 +387,7 @@ void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) // Test if making the path relative is possible before asking the user if they want to do it if( relPathTest.MakeRelativeTo( defaultPath ) ) { - msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ), - GetChars( defaultPath ) ); + msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ), defaultPath ); wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ), wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT ); @@ -804,8 +803,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) if( !EnsureFileDirectoryExists( &outputDir, boardFilename, &reporter ) ) { wxString msg; - msg.Printf( _( "Could not write plot files to folder \"%s\"." ), - GetChars( outputDir.GetPath() ) ); + msg.Printf( _( "Could not write plot files to folder \"%s\"." ), outputDir.GetPath() ); DisplayError( this, msg ); return; } diff --git a/pcbnew/exporters/gen_footprints_placefile.cpp b/pcbnew/exporters/gen_footprints_placefile.cpp index 95549f5541..307c45755b 100644 --- a/pcbnew/exporters/gen_footprints_placefile.cpp +++ b/pcbnew/exporters/gen_footprints_placefile.cpp @@ -345,8 +345,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles() if( !EnsureFileDirectoryExists( &outputDir, boardFilename, m_reporter ) ) { - msg.Printf( _( "Could not write plot files to folder \"%s\"." ), - GetChars( outputDir.GetPath() ) ); + msg.Printf( _( "Could not write plot files to folder \"%s\"." ), outputDir.GetPath() ); DisplayError( this, msg ); return false; } diff --git a/pcbnew/exporters/gendrill_Excellon_writer.cpp b/pcbnew/exporters/gendrill_Excellon_writer.cpp index 79260fb893..fb8b9973e5 100644 --- a/pcbnew/exporters/gendrill_Excellon_writer.cpp +++ b/pcbnew/exporters/gendrill_Excellon_writer.cpp @@ -116,7 +116,7 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory, { if( aReporter ) { - msg.Printf( _( "** Unable to create %s **\n" ), GetChars( fullFilename ) ); + msg.Printf( _( "** Unable to create %s **\n" ), fullFilename ); aReporter->Report( msg ); } break; @@ -125,7 +125,7 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory, { if( aReporter ) { - msg.Printf( _( "Create file %s\n" ), GetChars( fullFilename ) ); + msg.Printf( _( "Create file %s\n" ), fullFilename ); aReporter->Report( msg ); } } diff --git a/pcbnew/exporters/gendrill_file_writer_base.cpp b/pcbnew/exporters/gendrill_file_writer_base.cpp index 7f4348a43e..8501e34f47 100644 --- a/pcbnew/exporters/gendrill_file_writer_base.cpp +++ b/pcbnew/exporters/gendrill_file_writer_base.cpp @@ -331,7 +331,7 @@ void GENDRILL_WRITER_BASE::CreateMapFilesSet( const wxString& aPlotDirectory, { if( aReporter ) { - msg.Printf( _( "** Unable to create %s **\n" ), GetChars( fullfilename ) ); + msg.Printf( _( "** Unable to create %s **\n" ), fullfilename ); aReporter->Report( msg ); } @@ -341,7 +341,7 @@ void GENDRILL_WRITER_BASE::CreateMapFilesSet( const wxString& aPlotDirectory, { if( aReporter ) { - msg.Printf( _( "Create file %s\n" ), GetChars( fullfilename ) ); + msg.Printf( _( "Create file %s\n" ), fullfilename ); aReporter->Report( msg ); } } diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index e824aeec34..f889dc8182 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -973,7 +973,7 @@ bool FOOTPRINT_EDIT_FRAME::RevertFootprint() if( GetScreen()->IsModify() && m_revertModule ) { wxString msg = wxString::Format( _( "Revert \"%s\" to last version saved?" ), - GetChars( GetLoadedFPID().GetLibItemName() ) ); + GetLoadedFPID().GetLibItemName().wx_str() ); if( ConfirmRevertDialog( this, msg ) ) { diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 4f7eb759f7..8d9ad1679d 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -572,7 +572,7 @@ void FOOTPRINT_WIZARD_FRAME::OnActivate( wxActivateEvent& event ) void FOOTPRINT_WIZARD_FRAME::Update3DView( bool aForceReload, const wxString* aTitle ) { wxString frm3Dtitle; - frm3Dtitle.Printf( _( "ModView: 3D Viewer [%s]" ), GetChars( m_wizardName ) ); + frm3Dtitle.Printf( _( "ModView: 3D Viewer [%s]" ), m_wizardName ); PCB_BASE_FRAME::Update3DView( aForceReload, &frm3Dtitle ); } diff --git a/pcbnew/github/github_getliblist.cpp b/pcbnew/github/github_getliblist.cpp index 0667d66ab2..8512bb2060 100644 --- a/pcbnew/github/github_getliblist.cpp +++ b/pcbnew/github/github_getliblist.cpp @@ -102,7 +102,7 @@ bool GITHUB_GETLIBLIST::GetFootprintLibraryList( wxArrayString& aList ) if( !repoURL2listURL( m_repoURL, &fullURLCommand, itemCountMax, page ) ) { - wxString msg = wxString::Format( _( "malformed URL:\n\"%s\"" ), GetChars( m_repoURL ) ); + wxString msg = wxString::Format( _( "malformed URL:\n\"%s\"" ), m_repoURL ); wxMessageBox( msg ); return false; } diff --git a/pcbnew/github/github_plugin.cpp b/pcbnew/github/github_plugin.cpp index 44809bd80c..dcb6fc77ea 100644 --- a/pcbnew/github/github_plugin.cpp +++ b/pcbnew/github/github_plugin.cpp @@ -295,8 +295,8 @@ void GITHUB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxStrin { wxString msg = wxString::Format( _( "Footprint\n\"%s\"\nis not in the writable portion of this Github library\n\"%s\"" ), - GetChars( aFootprintName ), - GetChars( aLibraryPath ) + aFootprintName, + aLibraryPath ); THROW_IO_ERROR( msg ); @@ -400,8 +400,8 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP { wxString msg = wxString::Format( _( "option \"%s\" for Github library \"%s\" must point to a writable directory ending with '.pretty'." ), - GetChars( FROM_UTF8( PRETTY_DIR ) ), - GetChars( aLibraryPath ) + FROM_UTF8( PRETTY_DIR ), + aLibraryPath ); THROW_IO_ERROR( msg ); @@ -553,7 +553,7 @@ void GITHUB_PLUGIN::remoteGetZip( const wxString& aRepoURL ) if( !repoURL_zipURL( aRepoURL, &zip_url ) ) { - wxString msg = wxString::Format( _( "Unable to parse URL:\n\"%s\"" ), GetChars( aRepoURL ) ); + wxString msg = wxString::Format( _( "Unable to parse URL:\n\"%s\"" ), aRepoURL ); THROW_IO_ERROR( msg ); } diff --git a/pcbnew/netlist_reader/legacy_netlist_reader.cpp b/pcbnew/netlist_reader/legacy_netlist_reader.cpp index 0b12159100..9dd607a96e 100644 --- a/pcbnew/netlist_reader/legacy_netlist_reader.cpp +++ b/pcbnew/netlist_reader/legacy_netlist_reader.cpp @@ -244,7 +244,7 @@ void LEGACY_NETLIST_READER::loadFootprintFilters() { wxString msg; msg.Printf( _( "Cannot find symbol \"%s\" in footprint filter section " - "of netlist." ), GetChars( cmpRef ) ); + "of netlist." ), cmpRef ); THROW_PARSE_ERROR( msg, m_lineReader->GetSource(), line, m_lineReader->LineNumber(), m_lineReader->Length() ); } diff --git a/pcbnew/netlist_reader/netlist.cpp b/pcbnew/netlist_reader/netlist.cpp index 2bd6eae810..6e5e237d42 100644 --- a/pcbnew/netlist_reader/netlist.cpp +++ b/pcbnew/netlist_reader/netlist.cpp @@ -63,7 +63,7 @@ bool PCB_EDIT_FRAME::ReadNetlistFromFile( const wxString &aFilename, NETLIST& aN if( !netlistReader.get() ) { - msg.Printf( _( "Cannot open netlist file \"%s\"." ), GetChars( aFilename ) ); + msg.Printf( _( "Cannot open netlist file \"%s\"." ), aFilename ); wxMessageBox( msg, _( "Netlist Load Error." ), wxOK | wxICON_ERROR, this ); return false; } @@ -169,8 +169,8 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter ) { msg.Printf( _( "Footprint of %s changed: board footprint \"%s\", netlist footprint \"%s\"." ), component->GetReference(), - GetChars( fpOnBoard->GetFPID().Format() ), - GetChars( component->GetFPID().Format() ) ); + fpOnBoard->GetFPID().Format().wx_str(), + component->GetFPID().Format().wx_str() ); aReporter.Report( msg, RPT_SEVERITY_WARNING ); continue; @@ -192,7 +192,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter ) { msg.Printf( _( "%s footprint ID \"%s\" is not valid." ), component->GetReference(), - GetChars( component->GetFPID().Format() ) ); + component->GetFPID().Format().wx_str() ); aReporter.Report( msg, RPT_SEVERITY_ERROR ); continue; @@ -209,7 +209,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter ) { msg.Printf( _( "%s footprint \"%s\" not found in any libraries in the footprint library table.\n" ), component->GetReference(), - GetChars( component->GetFPID().GetLibItemName() ) ); + component->GetFPID().GetLibItemName().wx_str() ); aReporter.Report( msg, RPT_SEVERITY_ERROR ); continue; diff --git a/pcbnew/pcbplot.cpp b/pcbnew/pcbplot.cpp index 6ab9317a3e..07405f5936 100644 --- a/pcbnew/pcbplot.cpp +++ b/pcbnew/pcbplot.cpp @@ -198,7 +198,7 @@ const wxString GetGerberFileFunctionAttribute( const BOARD *aBoard, LAYER_NUM aL #endif wxString fileFct; - fileFct.Printf( "%%TF.FileFunction,%s*%%", GetChars( attrib ) ); + fileFct.Printf( "%%TF.FileFunction,%s*%%", attrib ); return fileFct; } @@ -318,7 +318,7 @@ void AddGerberX2Header( PLOTTER * aPlotter, if( rev.IsEmpty() ) rev = wxT( "rev?" ); - text.Printf( wxT( "%%TF.ProjectId,%s,%s,%s*%%" ), msg.ToAscii(), GetChars( guid ), rev.ToAscii() ); + text.Printf( wxT( "%%TF.ProjectId,%s,%s,%s*%%" ), msg.ToAscii(), guid, rev.ToAscii() ); aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) ); // Add the TF.SameCoordinates, that specify all gerber files uses the same diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index 6436666f92..410b963467 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -1102,7 +1102,7 @@ void ALTIUM_PCB::ParseModelsData( const CFB::CompoundFileReader& aReader, { wxLogError( wxString::Format( _( "Cannot create directory \"%s\" -> no 3D-models will be imported." ), - GetChars( altiumModelsPath.GetFullPath() ) ) ); + altiumModelsPath.GetFullPath() ) ); return; } } @@ -1127,7 +1127,7 @@ void ALTIUM_PCB::ParseModelsData( const CFB::CompoundFileReader& aReader, { wxLogError( wxString::Format( _( "You do not have write permissions to save file \"%s\"." ), - GetChars( storagePath.GetFullPath() ) ) ); + storagePath.GetFullPath() ) ); continue; } diff --git a/pcbnew/plugins/eagle/eagle_plugin.cpp b/pcbnew/plugins/eagle/eagle_plugin.cpp index d38737ae38..29194d02b5 100644 --- a/pcbnew/plugins/eagle/eagle_plugin.cpp +++ b/pcbnew/plugins/eagle/eagle_plugin.cpp @@ -949,10 +949,7 @@ void EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLib, const wxString* aLibName ) const wxString& pkg = pack_ref; wxString emsg = wxString::Format( - _( " name: \"%s\" duplicated in eagle : \"%s\"" ), - GetChars( pkg ), - GetChars( lib ) - ); + _( " name: \"%s\" duplicated in eagle : \"%s\"" ), pkg, lib ); THROW_IO_ERROR( emsg ); } @@ -1027,8 +1024,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements ) if( mi == m_templates.end() ) { wxString emsg = wxString::Format( _( "No \"%s\" package in library \"%s\"" ), - GetChars( FROM_UTF8( e.package.c_str() ) ), - GetChars( FROM_UTF8( e.library.c_str() ) ) ); + FROM_UTF8( e.package.c_str() ), FROM_UTF8( e.library.c_str() ) ); THROW_IO_ERROR( emsg ); } diff --git a/pcbnew/plugins/geda/gpcb_plugin.cpp b/pcbnew/plugins/geda/gpcb_plugin.cpp index 0c0511c4fd..2e5d34ba11 100644 --- a/pcbnew/plugins/geda/gpcb_plugin.cpp +++ b/pcbnew/plugins/geda/gpcb_plugin.cpp @@ -344,7 +344,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader ) if( parameters[0].CmpNoCase( wxT( "Element" ) ) != 0 ) { - msg.Printf( _( "unknown token \"%s\"" ), GetChars( parameters[0] ) ); + msg.Printf( _( "unknown token \"%s\"" ), parameters[0] ); THROW_PARSE_ERROR( msg, aLineReader->GetSource(), (const char *)aLineReader, aLineReader->LineNumber(), 0 ); } @@ -449,8 +449,8 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader ) conv_unit = NEW_GPCB_UNIT_CONV; } - wxLogTrace( traceGedaPcbPlugin, wxT( "%s parameter count = %d." ), - GetChars( parameters[0] ), paramCnt ); + wxLogTrace( + traceGedaPcbPlugin, wxT( "%s parameter count = %d." ), parameters[0], paramCnt ); // Parse a line with format: ElementLine [X1 Y1 X2 Y2 Thickness] if( parameters[0].CmpNoCase( wxT( "ElementLine" ) ) == 0 ) diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index f3245298f6..3c94224903 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -185,7 +185,7 @@ void FP_CACHE::Save( MODULE* aModule ) // renaming the file. { wxLogTrace( traceKicadPcbPlugin, wxT( "Creating temporary library file %s" ), - GetChars( tempFileName ) ); + tempFileName ); FILE_OUTPUTFORMATTER formatter( tempFileName ); @@ -204,9 +204,7 @@ void FP_CACHE::Save( MODULE* aModule ) { wxString msg = wxString::Format( _( "Cannot rename temporary file \"%s\" to footprint library file \"%s\"" ), - GetChars( tempFileName ), - GetChars( fn.GetFullPath() ) - ); + tempFileName, fn.GetFullPath() ); THROW_IO_ERROR( msg ); } #endif @@ -2233,8 +2231,8 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootpri if( !m_cache->Exists() ) { const wxString msg = wxString::Format( _( "Library \"%s\" does not exist.\n" - "Would you like to create it?"), - GetChars( aLibraryPath ) ); + "Would you like to create it?"), + aLibraryPath ); if( wxMessageBox( msg, _( "Library Not Found"), wxYES_NO | wxICON_QUESTION ) != wxYES ) return; diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index d0fe626343..24dc95ac60 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -148,7 +148,7 @@ double PCB_PARSER::parseDouble() { wxString error; error.Printf( _( "Invalid floating point number in\nfile: \"%s\"\nline: %d\noffset: %d" ), - GetChars( CurSource() ), CurLineNumber(), CurOffset() ); + CurSource(), CurLineNumber(), CurOffset() ); THROW_IO_ERROR( error ); } @@ -157,7 +157,7 @@ double PCB_PARSER::parseDouble() { wxString error; error.Printf( _( "Missing floating point number in\nfile: \"%s\"\nline: %d\noffset: %d" ), - GetChars( CurSource() ), CurLineNumber(), CurOffset() ); + CurSource(), CurLineNumber(), CurOffset() ); THROW_IO_ERROR( error ); } @@ -513,7 +513,7 @@ BOARD_ITEM* PCB_PARSER::Parse() default: wxString err; - err.Printf( _( "Unknown token \"%s\"" ), GetChars( FromUTF8() ) ); + err.Printf( _( "Unknown token \"%s\"" ), FromUTF8() ); THROW_PARSE_ERROR( err, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); } @@ -638,7 +638,7 @@ BOARD* PCB_PARSER::parseBOARD_unchecked() default: wxString err; - err.Printf( _( "Unknown token \"%s\"" ), GetChars( FromUTF8() ) ); + err.Printf( _( "Unknown token \"%s\"" ), FromUTF8() ); THROW_PARSE_ERROR( err, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); } } @@ -889,7 +889,7 @@ void PCB_PARSER::parsePAGE_INFO() if( !pageInfo.SetType( pageType ) ) { wxString err; - err.Printf( _( "Page type \"%s\" is not valid " ), GetChars( FromUTF8() ) ); + err.Printf( _( "Page type \"%s\" is not valid " ), FromUTF8() ); THROW_PARSE_ERROR( err, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); } @@ -1421,8 +1421,8 @@ void PCB_PARSER::parseLayers() { wxString error = wxString::Format( _( "Layer \"%s\" in file \"%s\" at line %d, is not in fixed layer hash" ), - GetChars( layer.m_name ), - GetChars( CurSource() ), + layer.m_name, + CurSource(), CurLineNumber(), CurOffset() ); @@ -2801,7 +2801,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments ) { wxString error; error.Printf( _( "Invalid footprint ID in\nfile: \"%s\"\nline: %d\noffset: %d" ), - GetChars( CurSource() ), CurLineNumber(), CurOffset() ); + CurSource(), CurLineNumber(), CurOffset() ); THROW_IO_ERROR( error ); } @@ -3103,7 +3103,7 @@ FP_TEXT* PCB_PARSER::parseFP_TEXT() { wxCHECK_MSG( CurTok() == T_fp_text, NULL, wxString::Format( wxT( "Cannot parse %s as FP_TEXT at line %d, offset %d." ), - GetChars( GetTokenString( CurTok() ) ), + GetTokenString( CurTok() ), CurLineNumber(), CurOffset() ) ); T token = NextTok(); @@ -3124,8 +3124,8 @@ FP_TEXT* PCB_PARSER::parseFP_TEXT() break; // Default type is user text. default: - THROW_IO_ERROR( wxString::Format( _( "Cannot handle footprint text type %s" ), - GetChars( FromUTF8() ) ) ); + THROW_IO_ERROR( + wxString::Format( _( "Cannot handle footprint text type %s" ), FromUTF8() ) ); } NeedSYMBOLorNUMBER(); @@ -4055,8 +4055,8 @@ ARC* PCB_PARSER::parseARC() case T_net: if( !arc->SetNetCode( getNetCode( parseInt( "net number" ) ), /* aNoAssert */ true ) ) THROW_IO_ERROR( wxString::Format( - _( "Invalid net ID in\nfile: \"%s\"\nline: %d\noffset: %d" ), - GetChars( CurSource() ), CurLineNumber(), CurOffset() ) ); + _( "Invalid net ID in\nfile: \"%s\"\nline: %d\noffset: %d" ), CurSource(), + CurLineNumber(), CurOffset() ) ); break; case T_tstamp: @@ -4124,11 +4124,10 @@ TRACK* PCB_PARSER::parseTRACK() break; case T_net: - if( ! track->SetNetCode( getNetCode( parseInt( "net number" ) ), /* aNoAssert */ true ) ) - THROW_IO_ERROR( - wxString::Format( _( "Invalid net ID in\nfile: \"%s\"\nline: %d\noffset: %d" ), - GetChars( CurSource() ), CurLineNumber(), CurOffset() ) - ); + if( !track->SetNetCode( getNetCode( parseInt( "net number" ) ), /* aNoAssert */ true ) ) + THROW_IO_ERROR( wxString::Format( + _( "Invalid net ID in\nfile: \"%s\"\nline: %d\noffset: %d" ), CurSource(), + CurLineNumber(), CurOffset() ) ); break; case T_tstamp: @@ -4215,7 +4214,7 @@ VIA* PCB_PARSER::parseVIA() if(! via->SetNetCode( getNetCode( parseInt( "net number" ) ), /* aNoAssert */ true)) THROW_IO_ERROR( wxString::Format( _( "Invalid net ID in\nfile: \"%s\"\nline: %d\noffset: %d" ), - GetChars( CurSource() ), CurLineNumber(), CurOffset() ) + CurSource(), CurLineNumber(), CurOffset() ) ); NeedRIGHT(); break; @@ -4301,11 +4300,10 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER( BOARD_ITEM_CONTAINER* aParent ) if( tmp < 0 ) tmp = 0; - if( ! zone->SetNetCode( tmp, /* aNoAssert */ true ) ) - THROW_IO_ERROR( - wxString::Format( _( "Invalid net ID in\nfile: \"%s\"\nline: %d\noffset: %d" ), - GetChars( CurSource() ), CurLineNumber(), CurOffset() ) - ); + if( !zone->SetNetCode( tmp, /* aNoAssert */ true ) ) + THROW_IO_ERROR( wxString::Format( + _( "Invalid net ID in\nfile: \"%s\"\nline: %d\noffset: %d" ), CurSource(), + CurLineNumber(), CurOffset() ) ); NeedRIGHT(); break; diff --git a/pcbnew/plugins/legacy/legacy_plugin.cpp b/pcbnew/plugins/legacy/legacy_plugin.cpp index 63535c7bb9..65087369f4 100644 --- a/pcbnew/plugins/legacy/legacy_plugin.cpp +++ b/pcbnew/plugins/legacy/legacy_plugin.cpp @@ -1393,8 +1393,7 @@ void LEGACY_PLUGIN::loadMODULE( MODULE* aModule ) } wxString msg = wxString::Format( - _( "Missing '$EndMODULE' for MODULE \"%s\"" ), - GetChars( aModule->GetFPID().GetLibItemName() ) ); + _( "Missing '$EndMODULE' for MODULE \"%s\"" ), aModule->GetFPID().GetLibItemName().wx_str() ); THROW_IO_ERROR( msg ); } @@ -1448,7 +1447,7 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule ) padchar, padchar, m_reader->LineNumber(), - GetChars( aModule->GetFPID().GetLibItemName() ) + aModule->GetFPID().GetLibItemName().wx_str() ); THROW_IO_ERROR( m_error ); } @@ -1651,7 +1650,7 @@ void LEGACY_PLUGIN::loadMODULE_EDGE( MODULE* aModule ) (unsigned char) line[1], (unsigned char) line[1], m_reader->LineNumber(), - GetChars( aModule->GetFPID().GetLibItemName() ) + aModule->GetFPID().GetLibItemName().wx_str() ); THROW_IO_ERROR( m_error ); } diff --git a/pcbnew/specctra_import_export/specctra_export.cpp b/pcbnew/specctra_import_export/specctra_export.cpp index 4ee3e1c321..66745ceda9 100644 --- a/pcbnew/specctra_import_export/specctra_export.cpp +++ b/pcbnew/specctra_import_export/specctra_export.cpp @@ -907,16 +907,18 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) if( module->GetReference() == wxEmptyString ) { - THROW_IO_ERROR( wxString::Format( _( "Symbol with value of \"%s\" has empty reference id." ), - GetChars( module->GetValue() ) ) ); + THROW_IO_ERROR( wxString::Format( + _( "Symbol with value of \"%s\" has empty reference id." ), + module->GetValue() ) ); } // if we cannot insert OK, that means the reference has been seen before. STRINGSET_PAIR refpair = refs.insert( TO_UTF8( module->GetReference() ) ); if( !refpair.second ) // insert failed { - THROW_IO_ERROR( wxString::Format( _( "Multiple symbols have identical reference IDs of \"%s\"." ), - GetChars( module->GetReference() ) ) ); + THROW_IO_ERROR( wxString::Format( + _( "Multiple symbols have identical reference IDs of \"%s\"." ), + module->GetReference() ) ); } } } diff --git a/pcbnew/specctra_import_export/specctra_import.cpp b/pcbnew/specctra_import_export/specctra_import.cpp index e478f3c2c0..17bdc376d4 100644 --- a/pcbnew/specctra_import_export/specctra_import.cpp +++ b/pcbnew/specctra_import_export/specctra_import.cpp @@ -163,8 +163,8 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) if( layerNdx == -1 ) { wxString layerName = FROM_UTF8( aPath->layer_id.c_str() ); - THROW_IO_ERROR( wxString::Format( _("Session file uses invalid layer id \"%s\""), - GetChars( layerName ) ) ); + THROW_IO_ERROR( + wxString::Format( _( "Session file uses invalid layer id \"%s\"" ), layerName ) ); } TRACK* track = new TRACK( sessionBoard ); @@ -222,8 +222,8 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) shape = (SHAPE*) (*aPadstack)[0]; DSN_T type = shape->shape->Type(); if( type != T_circle ) - THROW_IO_ERROR( wxString::Format( _( "Unsupported via shape: %s"), - GetChars( GetTokenString( type ) ) ) ); + THROW_IO_ERROR( + wxString::Format( _( "Unsupported via shape: %s" ), GetTokenString( type ) ) ); CIRCLE* circle = (CIRCLE*) shape->shape; int viaDiam = scale( circle->diameter, routeResolution ); @@ -240,8 +240,8 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) shape = (SHAPE*) (*aPadstack)[0]; DSN_T type = shape->shape->Type(); if( type != T_circle ) - THROW_IO_ERROR( wxString::Format( _( "Unsupported via shape: %s"), - GetChars( GetTokenString( type ) ) ) ); + THROW_IO_ERROR( + wxString::Format( _( "Unsupported via shape: %s" ), GetTokenString( type ) ) ); CIRCLE* circle = (CIRCLE*) shape->shape; int viaDiam = scale( circle->diameter, routeResolution ); @@ -265,8 +265,8 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) shape = (SHAPE*) (*aPadstack)[i]; DSN_T type = shape->shape->Type(); if( type != T_circle ) - THROW_IO_ERROR( wxString::Format( _( "Unsupported via shape: %s"), - GetChars( GetTokenString( type ) ) ) ); + THROW_IO_ERROR( wxString::Format( + _( "Unsupported via shape: %s" ), GetTokenString( type ) ) ); CIRCLE* circle = (CIRCLE*) shape->shape; @@ -274,8 +274,8 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) if( layerNdx == -1 ) { wxString layerName = FROM_UTF8( circle->layer_id.c_str() ); - THROW_IO_ERROR( wxString::Format( _("Session file uses invalid layer id \"%s\""), - GetChars( layerName ) ) ); + THROW_IO_ERROR( wxString::Format( + _( "Session file uses invalid layer id \"%s\"" ), layerName ) ); } if( layerNdx > topLayerNdx ) @@ -493,8 +493,8 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) // wire_via to text and put that text into the exception. wxString psid( FROM_UTF8( wire_via->GetPadstackId().c_str() ) ); - THROW_IO_ERROR( wxString::Format( _("A wire_via references a missing padstack \"%s\""), - GetChars( psid ) ) ); + THROW_IO_ERROR( wxString::Format( + _( "A wire_via references a missing padstack \"%s\"" ), psid ) ); } NETCLASSPTR netclass = aBoard->GetDesignSettings().GetNetClasses().GetDefault(); diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index ea5db0317d..eb4256337e 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -956,7 +956,7 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName ) } catch( const IO_ERROR& ioe ) { - wxString msg = wxString::Format( _( "Error loading board.\n%s" ), GetChars( ioe.What() )); + wxString msg = wxString::Format( _( "Error loading board.\n%s" ), ioe.What() ); DisplayError( editFrame, msg ); return 0; diff --git a/qa/qa_utils/test_app_main.cpp b/qa/qa_utils/test_app_main.cpp index 0b2b185b35..3b96317eaf 100644 --- a/qa/qa_utils/test_app_main.cpp +++ b/qa/qa_utils/test_app_main.cpp @@ -182,12 +182,12 @@ struct APP_TEST : public wxApp catch( const std::exception& e ) { wxLogError( wxT( "Unhandled exception class: %s what: %s" ), - GetChars( FROM_UTF8( typeid(e).name() )), - GetChars( FROM_UTF8( e.what() ) ) ); + FROM_UTF8( typeid(e).name() ), + FROM_UTF8( e.what() ) ); } catch( const IO_ERROR& ioe ) { - wxLogError( GetChars( ioe.What() ) ); + wxLogError( ioe.What() ); } catch(...) { @@ -218,12 +218,12 @@ struct APP_TEST : public wxApp catch( const std::exception& e ) { wxLogError( wxT( "Unhandled exception class: %s what: %s" ), - GetChars( FROM_UTF8( typeid(e).name() )), - GetChars( FROM_UTF8( e.what() ) ) ); + FROM_UTF8( typeid(e).name() ), + FROM_UTF8( e.what() ) ); } catch( const IO_ERROR& ioe ) { - wxLogError( GetChars( ioe.What() ) ); + wxLogError( ioe.What() ); } catch(...) {