From cc147d1660066bc21d5c0ad595f94a3cfd1a3114 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 28 Sep 2011 19:43:48 +0000 Subject: [PATCH] Eliminate uses of c_str made unnecessary by changed to wxString::Format in wx 2.9 Originally committed to SVN as r5612. --- aegisub/src/aegisublocale.cpp | 2 +- aegisub/src/ass_dialogue.cpp | 12 ++++++------ aegisub/src/ass_exporter.cpp | 4 ++-- aegisub/src/ass_file.cpp | 2 +- aegisub/src/ass_override.cpp | 2 +- aegisub/src/ass_style.cpp | 18 +++++++++--------- aegisub/src/audio_provider_hd.cpp | 2 +- aegisub/src/auto4_base.cpp | 12 ++++++------ aegisub/src/auto4_lua.cpp | 4 ++-- aegisub/src/auto4_lua_assfile.cpp | 2 +- aegisub/src/auto4_lua_dialog.cpp | 8 ++++---- aegisub/src/command/automation.cpp | 2 +- aegisub/src/command/help.cpp | 2 +- aegisub/src/dialog_automation.cpp | 14 +++++++------- aegisub/src/dialog_fonts_collector.cpp | 14 +++++++------- aegisub/src/dialog_kara_timing_copy.cpp | 2 +- aegisub/src/dialog_style_manager.cpp | 10 +++++----- aegisub/src/dialog_version_check.cpp | 2 +- aegisub/src/ffmpegsource_common.cpp | 10 +++++----- aegisub/src/frame_main.cpp | 4 ++-- aegisub/src/help_button.cpp | 2 +- aegisub/src/main.cpp | 2 +- aegisub/src/mkv_wrap.cpp | 2 +- aegisub/src/subs_edit_ctrl.cpp | 2 +- aegisub/src/subtitle_format.cpp | 2 +- aegisub/src/subtitle_format_encore.cpp | 2 +- aegisub/src/subtitle_format_microdvd.cpp | 2 +- aegisub/src/text_file_writer.cpp | 2 +- aegisub/src/utils.cpp | 2 +- aegisub/src/video_context.cpp | 6 +++--- aegisub/src/video_display.cpp | 8 ++++---- aegisub/src/video_provider_yuv4mpeg.cpp | 2 +- 32 files changed, 81 insertions(+), 81 deletions(-) diff --git a/aegisub/src/aegisublocale.cpp b/aegisub/src/aegisublocale.cpp index bdf214347..048677e87 100644 --- a/aegisub/src/aegisublocale.cpp +++ b/aegisub/src/aegisublocale.cpp @@ -185,7 +185,7 @@ wxArrayInt AegisubLocale::GetAvailableLanguages() { // If the locale file doesn't exist then don't list it as an option. wxString locDir = wxStandardPaths::Get().GetLocalizedResourcesDir(langs[i], wxStandardPathsBase::ResourceCat_Messages); - wxFileName file(wxString::Format("%s/%s.mo", locDir.c_str(), GETTEXT_PACKAGE)); + wxFileName file(wxString::Format("%s/%s.mo", locDir, GETTEXT_PACKAGE)); if (lang && file.FileExists()) final.Add(lang->Language); } #endif diff --git a/aegisub/src/ass_dialogue.cpp b/aegisub/src/ass_dialogue.cpp index 537d56476..286843f6e 100644 --- a/aegisub/src/ass_dialogue.cpp +++ b/aegisub/src/ass_dialogue.cpp @@ -220,13 +220,13 @@ wxString AssDialogue::GetData(bool ssa) const { wxString str = wxString::Format( "%s: %s,%s,%s,%s,%s,%d,%d,%d,%s,%s", Comment ? "Comment" : "Dialogue", - ssa ? "Marked=0" : wxString::Format("%01d", Layer).c_str(), - Start.GetASSFormated().c_str(), - End.GetASSFormated().c_str(), - s.c_str(), a.c_str(), + ssa ? "Marked=0" : wxString::Format("%01d", Layer), + Start.GetASSFormated(), + End.GetASSFormated(), + s, a, Margin[0], Margin[1], Margin[2], - e.c_str(), - Text.c_str()); + e, + Text); // Make sure that final has no line breaks str.Replace("\n", ""); diff --git a/aegisub/src/ass_exporter.cpp b/aegisub/src/ass_exporter.cpp index 112366091..647553239 100644 --- a/aegisub/src/ass_exporter.cpp +++ b/aegisub/src/ass_exporter.cpp @@ -97,7 +97,7 @@ void AssExporter::AddFilter(wxString name) { } // Check - if (!filter) throw wxString::Format("Filter not found: %s", name.c_str()); + if (!filter) throw wxString::Format("Filter not found: %s", name); // Add to list Filters.push_back(filter); @@ -177,5 +177,5 @@ wxString AssExporter::GetDescription(wxString name) { return (*cur)->GetDescription(); } } - throw wxString::Format("Filter not found: %s", name.c_str()); + throw wxString::Format("Filter not found: %s", name); } diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index c0f024929..cf904c8e3 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -116,7 +116,7 @@ void AssFile::Load(const wxString &_filename,wxString charset,bool addToRecent) // Real exception catch (agi::Exception &e) { - wxMessageBox(wxString(e.GetChainedMessage().c_str(), wxConvUTF8), "Error loading file", wxICON_ERROR|wxOK); + wxMessageBox(lagi_wxString(e.GetChainedMessage()), "Error loading file", wxICON_ERROR|wxOK); return; } diff --git a/aegisub/src/ass_override.cpp b/aegisub/src/ass_override.cpp index 5a2b91a07..4cc63ad85 100644 --- a/aegisub/src/ass_override.cpp +++ b/aegisub/src/ass_override.cpp @@ -340,7 +340,7 @@ std::vector tokenize(const wxString &text) { else if (c == ')') { parDepth--; if (parDepth < 0) { - wxLogWarning("Unmatched parenthesis near '%s'!\nTag-parsing incomplete.", text.SubString(i, 10).c_str()); + wxLogWarning("Unmatched parenthesis near '%s'!\nTag-parsing incomplete.", text.SubString(i, 10)); return paramList; } else if (parDepth == 0) { diff --git a/aegisub/src/ass_style.cpp b/aegisub/src/ass_style.cpp index 43993ef93..4f02b980b 100644 --- a/aegisub/src/ass_style.cpp +++ b/aegisub/src/ass_style.cpp @@ -429,11 +429,11 @@ void AssStyle::UpdateData() { final = wxString::Format("Style: %s,%s,%g,%s,%s,%s,%s,%d,%d,%d,%d,%g,%g,%g,%g,%d,%g,%g,%i,%i,%i,%i,%i", - name.c_str(), font.c_str(), fontsize, - primary.GetASSFormatted(true,false,true).c_str(), - secondary.GetASSFormatted(true,false,true).c_str(), - outline.GetASSFormatted(true,false,true).c_str(), - shadow.GetASSFormatted(true,false,true).c_str(), + name, font, fontsize, + primary.GetASSFormatted(true,false,true), + secondary.GetASSFormatted(true,false,true), + outline.GetASSFormatted(true,false,true), + shadow.GetASSFormatted(true,false,true), (bold? -1 : 0), (italic ? -1 : 0), (underline?-1:0),(strikeout?-1:0), scalex,scaley,spacing,angle, @@ -491,10 +491,10 @@ wxString AssStyle::GetSSAText() const { f.Replace(",", ";"); output = wxString::Format("Style: %s,%s,%g,%s,%s,0,%s,%d,%d,%d,%g,%g,%d,%d,%d,%d,0,%i", - n.c_str(), f.c_str(), fontsize, - primary.GetSSAFormatted().c_str(), - secondary.GetSSAFormatted().c_str(), - shadow.GetSSAFormatted().c_str(), + n, f, fontsize, + primary.GetSSAFormatted(), + secondary.GetSSAFormatted(), + shadow.GetSSAFormatted(), (bold? -1 : 0), (italic ? -1 : 0), borderstyle,outline_w,shadow_w,align, Margin[0],Margin[1],Margin[2],encoding); diff --git a/aegisub/src/audio_provider_hd.cpp b/aegisub/src/audio_provider_hd.cpp index 50da65452..566a149f1 100644 --- a/aegisub/src/audio_provider_hd.cpp +++ b/aegisub/src/audio_provider_hd.cpp @@ -165,7 +165,7 @@ wxString HDAudioProvider::DiskCacheName() { // Try from 00 to 99 for (int i=0;i<100;i++) { // File exists? - wxString curStringTry = DiskCachePath() + wxString::Format(pattern.c_str(),i); + wxString curStringTry = DiskCachePath() + wxString::Format(pattern,i); if (!wxFile::Exists(curStringTry)) return curStringTry; } return ""; diff --git a/aegisub/src/auto4_base.cpp b/aegisub/src/auto4_base.cpp index dd56d5685..da1174b56 100644 --- a/aegisub/src/auto4_base.cpp +++ b/aegisub/src/auto4_base.cpp @@ -104,7 +104,7 @@ namespace Automation4 { lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; lf.lfQuality = ANTIALIASED_QUALITY; lf.lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE; - _tcsncpy(lf.lfFaceName, style->font.c_str(), 32); + wcsncpy(lf.lfFaceName, style->font.wc_str(), 32); HFONT thefont = CreateFontIndirect(&lf); if (!thefont) return false; @@ -311,7 +311,7 @@ namespace Automation4 { /// wxString FeatureFilter::GetScriptSettingsIdentifier() { - return inline_string_encode(wxString::Format("Automation Settings %s", GetName().c_str())); + return inline_string_encode(wxString::Format("Automation Settings %s", GetName())); } @@ -899,11 +899,11 @@ namespace Automation4 { } catch (const char *e) { error_count++; - wxLogError("Error loading Automation script: %s\n%s", fn.c_str(), e); + wxLogError("Error loading Automation script: %s\n%s", fn, e); } catch (...) { error_count++; - wxLogError("Error loading Automation script: %s\nUnknown error.", fn.c_str()); + wxLogError("Error loading Automation script: %s\nUnknown error.", fn); } more = dir.GetNext(&fn); } @@ -991,7 +991,7 @@ namespace Automation4 { Script *s = (*i)->Produce(filename); if (s) { if (!s->GetLoadedState() && log_errors) { - wxLogError(_("An Automation script failed to load. File name: '%s', error reported:"), filename.c_str()); + wxLogError(_("An Automation script failed to load. File name: '%s', error reported:"), filename); wxLogError(s->GetDescription()); } return s; @@ -1004,7 +1004,7 @@ namespace Automation4 { } } if (log_errors) { - wxLogWarning(_("The file was not recognised as an Automation script: %s"), filename.c_str()); + wxLogWarning(_("The file was not recognised as an Automation script: %s"), filename); } return new UnknownScript(filename); } diff --git a/aegisub/src/auto4_lua.cpp b/aegisub/src/auto4_lua.cpp index d0b0cc21f..674549afe 100644 --- a/aegisub/src/auto4_lua.cpp +++ b/aegisub/src/auto4_lua.cpp @@ -756,7 +756,7 @@ namespace Automation4 { bool result; if (err) { wxString errmsg(lua_tostring(L, -1), wxConvUTF8); - wxLogWarning("Runtime error in Lua macro validation function:\n%s", errmsg.c_str()); + wxLogWarning("Runtime error in Lua macro validation function:\n%s", errmsg); result = false; } else { result = !!lua_toboolean(L, -1); @@ -948,7 +948,7 @@ namespace Automation4 { int err = lua_pcall(L, 2, 1, 0); if (err) { wxString errmsg(lua_tostring(L, -1), wxConvUTF8); - wxLogWarning("Runtime error in Lua macro validation function:\n%s", errmsg.c_str()); + wxLogWarning("Runtime error in Lua macro validation function:\n%s", errmsg); lua_pop(L, 1); // remove error message return config_dialog = 0; } else { diff --git a/aegisub/src/auto4_lua_assfile.cpp b/aegisub/src/auto4_lua_assfile.cpp index 04642d76a..5e379ded4 100644 --- a/aegisub/src/auto4_lua_assfile.cpp +++ b/aegisub/src/auto4_lua_assfile.cpp @@ -342,7 +342,7 @@ namespace Automation4 { } else if (lclass == "info") { GETSTRING(key, "key", "info") GETSTRING(value, "value", "info") - result = new AssEntry(wxString::Format("%s: %s", key.c_str(), value.c_str())); + result = new AssEntry(wxString::Format("%s: %s", key, value)); result->group = "[Script Info]"; // just so it can be read correctly back } else if (lclass == "format") { diff --git a/aegisub/src/auto4_lua_dialog.cpp b/aegisub/src/auto4_lua_dialog.cpp index 7c387e7af..311d866a6 100644 --- a/aegisub/src/auto4_lua_dialog.cpp +++ b/aegisub/src/auto4_lua_dialog.cpp @@ -138,7 +138,7 @@ namespace Automation4 { } lua_pop(L, 1); - LOG_D("automation/lua/dialog") << "created control: '" << name.c_str() << "', (" << x << "," << y << ")(" << width << "," << height << ", "<< hint.c_str(); + LOG_D("automation/lua/dialog") << "created control: '" << STD_STR(name) << "', (" << x << "," << y << ")(" << width << "," << height << ", "<< STD_STR(hint); } @@ -1007,7 +1007,7 @@ badcontrol: if (buttons.size() > 0) { LOG_D("automation/lua/dialog") << "creating user buttons"; for (size_t i = 0; i < buttons.size(); ++i) { - LOG_D("automation/lua/dialog") << "button '" << buttons[i].c_str() << "' gets id " << 1001+(wxWindowID)i; + LOG_D("automation/lua/dialog") << "button '" << STD_STR(buttons[i]) << "' gets id " << 1001+(wxWindowID)i; bs->Add(new wxButton(w, 1001+(wxWindowID)i, buttons[i])); } @@ -1054,7 +1054,7 @@ badcontrol: LOG_D("automation/lua/dialog") << "default buttons, button 1 bushed, Ok button"; lua_pushboolean(L, 1); } else { - LOG_D("automation/lua/dialog") << "user button: " << buttons.at(btn-1).c_str(); + LOG_D("automation/lua/dialog") << "user button: " << STD_STR(buttons.at(btn-1)); // button_pushed is index+1 to reserve 0 for Cancel lua_pushstring(L, buttons.at(btn-1).mb_str(wxConvUTF8)); } @@ -1090,7 +1090,7 @@ badcontrol: if (controls[i]->CanSerialiseValue()) { wxString sn = inline_string_encode(controls[i]->name); wxString sv = controls[i]->SerialiseValue(); - res += wxString::Format("%s:%s|", sn.c_str(), sv.c_str()); + res += wxString::Format("%s:%s|", sn, sv); } } diff --git a/aegisub/src/command/automation.cpp b/aegisub/src/command/automation.cpp index 54b786031..d2deaf5c8 100644 --- a/aegisub/src/command/automation.cpp +++ b/aegisub/src/command/automation.cpp @@ -80,7 +80,7 @@ struct am_manager : public Command { } catch (const char *e) { wxLogError(e); } catch (...) { - wxLogError("An unknown error occurred reloading Automation script '%s'.", scripts[i]->GetName().c_str()); + wxLogError("An unknown error occurred reloading Automation script '%s'.", scripts[i]->GetName()); } } diff --git a/aegisub/src/command/help.cpp b/aegisub/src/command/help.cpp index 9bc4b075d..7bb34b31d 100644 --- a/aegisub/src/command/help.cpp +++ b/aegisub/src/command/help.cpp @@ -100,7 +100,7 @@ struct help_files : public Command { void operator()(agi::Context *c) { #ifdef __WXMAC__ char *shared_path = agi::util::OSX_GetBundleSharedSupportDirectory(); - wxString help_path = wxString::Format("%s/doc", wxString(shared_path, wxConvUTF8).c_str()); + wxString help_path = wxString::Format("%s/doc", wxString(shared_path, wxConvUTF8)); agi::util::OSX_OpenLocation(help_path.c_str()); free(shared_path); #endif diff --git a/aegisub/src/dialog_automation.cpp b/aegisub/src/dialog_automation.cpp index d4fcfa5c5..e4a402b69 100644 --- a/aegisub/src/dialog_automation.cpp +++ b/aegisub/src/dialog_automation.cpp @@ -215,7 +215,7 @@ void DialogAutomation::OnAdd(wxCommandEvent &evt) const Automation4::ScriptFactory *fact = factories[i]; if (fact->GetEngineName().IsEmpty() || fact->GetFilenamePattern().IsEmpty()) continue; - fnfilter = wxString::Format("%s%s scripts (%s)|%s|", fnfilter.c_str(), fact->GetEngineName().c_str(), fact->GetFilenamePattern().c_str(), fact->GetFilenamePattern().c_str()); + fnfilter = wxString::Format("%s%s scripts (%s)|%s|", fnfilter, fact->GetEngineName(), fact->GetFilenamePattern(), fact->GetFilenamePattern()); catchall << fact->GetFilenamePattern() << ";"; } #ifdef __WINDOWS__ @@ -323,16 +323,16 @@ void DialogAutomation::OnInfo(wxCommandEvent &evt) info += _("Scripting engines installed:\n"); const std::vector &factories = Automation4::ScriptFactory::GetFactories(); for (std::vector::const_iterator c = factories.begin(); c != factories.end(); ++c) { - info += wxString::Format("- %s (%s)\n", (*c)->GetEngineName().c_str(), (*c)->GetFilenamePattern().c_str()); + info += wxString::Format("- %s (%s)\n", (*c)->GetEngineName(), (*c)->GetFilenamePattern()); } if (ei) { info += wxString::Format(_("\nScript info:\nName: %s\nDescription: %s\nAuthor: %s\nVersion: %s\nFull path: %s\nState: %s\n\nFeatures provided by script:\n"), - ei->script->GetName().c_str(), - ei->script->GetDescription().c_str(), - ei->script->GetAuthor().c_str(), - ei->script->GetVersion().c_str(), - ei->script->GetFilename().c_str(), + ei->script->GetName(), + ei->script->GetDescription(), + ei->script->GetAuthor(), + ei->script->GetVersion(), + ei->script->GetFilename(), ei->script->GetLoadedState() ? _("Correctly loaded") : _("Failed to load")); for (std::vector::iterator f = ei->script->GetFeatures().begin(); f != ei->script->GetFeatures().end(); ++f) { switch ((*f)->GetClass()) { diff --git a/aegisub/src/dialog_fonts_collector.cpp b/aegisub/src/dialog_fonts_collector.cpp index ca2ee35be..eddad0d79 100644 --- a/aegisub/src/dialog_fonts_collector.cpp +++ b/aegisub/src/dialog_fonts_collector.cpp @@ -536,7 +536,7 @@ bool FontsCollectorThread::ProcessFont(wxString name) { int action = collector->CollectAction->GetSelection(); // Font name - AppendText(wxString::Format(_T("\"%s\"... "),name.c_str())); + AppendText(wxString::Format("\"%s\"... ", name)); // Get font list wxArrayString files = FontFileLister::GetFilesWithFace(name); @@ -565,14 +565,14 @@ bool FontsCollectorThread::ProcessFont(wxString name) { } if (tempResult == 1) { - AppendText(wxString::Format(_("* Copied %s.\n"),files[i].c_str()),1); + AppendText(wxString::Format(_("* Copied %s.\n"),files[i]),1); } else if (tempResult == 2) { wxFileName fn(files[i]); - AppendText(wxString::Format(_("* %s already exists on destination.\n"),fn.GetFullName().c_str()),3); + AppendText(wxString::Format(_("* %s already exists on destination.\n"),fn.GetFullName()),3); } else { - AppendText(wxString::Format(_("* Failed to copy %s.\n"),files[i].c_str()),2); + AppendText(wxString::Format(_("* Failed to copy %s.\n"),files[i]),2); result = false; } } @@ -662,9 +662,9 @@ void FontsCollectorThread::AddFont(wxString fontname,int mode) { if (fonts.Index(fontname) == wxNOT_FOUND) { fonts.Add(fontname); - if (mode == 0) AppendText(wxString::Format(_("\"%s\" found on style \"%s\".\n"), fontname.c_str(), curStyle->name.c_str())); - else if (mode == 1) AppendText(wxString::Format(_("\"%s\" found on dialogue line \"%d\".\n"), fontname.c_str(), curLine)); - else AppendText(wxString::Format(_("\"%s\" found.\n"), fontname.c_str())); + if (mode == 0) AppendText(wxString::Format(_("\"%s\" found on style \"%s\".\n"), fontname, curStyle->name)); + else if (mode == 1) AppendText(wxString::Format(_("\"%s\" found on dialogue line \"%d\".\n"), fontname, curLine)); + else AppendText(wxString::Format(_("\"%s\" found.\n"), fontname)); } } diff --git a/aegisub/src/dialog_kara_timing_copy.cpp b/aegisub/src/dialog_kara_timing_copy.cpp index 3ad7561f9..a8f936271 100644 --- a/aegisub/src/dialog_kara_timing_copy.cpp +++ b/aegisub/src/dialog_kara_timing_copy.cpp @@ -510,7 +510,7 @@ wxString KaraokeLineMatchDisplay::GetOutputLine() for (size_t i = 0; i < matched_groups.size(); ++i) { MatchGroup &match = matched_groups[i]; - res = wxString::Format("%s{\\k%d}%s", res.c_str(), match.duration, match.dst.c_str()); + res = wxString::Format("%s{\\k%d}%s", res, match.duration, match.dst); } return res; diff --git a/aegisub/src/dialog_style_manager.cpp b/aegisub/src/dialog_style_manager.cpp index 05cbf5bf0..525db0c47 100644 --- a/aegisub/src/dialog_style_manager.cpp +++ b/aegisub/src/dialog_style_manager.cpp @@ -435,7 +435,7 @@ void DialogStyleManager::OnCatalogNew (wxCommandEvent &) { // Warn about bad characters if (badchars_removed > 0) { - wxMessageBox(wxString::Format(_("The specified catalog name contains one or more illegal characters. They have been replaced with underscores instead.\nThe catalog has been renamed to \"%s\"."), name.c_str()),_("Invalid characters")); + wxMessageBox(wxString::Format(_("The specified catalog name contains one or more illegal characters. They have been replaced with underscores instead.\nThe catalog has been renamed to \"%s\"."), name),_("Invalid characters")); } // Add to list of storages @@ -462,7 +462,7 @@ void DialogStyleManager::OnCatalogDelete (wxCommandEvent &) { int sel = CatalogList->GetSelection(); if (sel != wxNOT_FOUND) { wxString name = CatalogList->GetString(sel); - wxString message = wxString::Format(_("Are you sure you want to delete the storage \"%s\" from the catalog?"), name.c_str()); + wxString message = wxString::Format(_("Are you sure you want to delete the storage \"%s\" from the catalog?"), name); int option = wxMessageBox(message, _("Confirm delete"), wxYES_NO | wxICON_EXCLAMATION , this); if (option == wxYES) { wxRemoveFile(StandardPaths::DecodePath("?user/catalog/" + name + ".sty")); @@ -543,7 +543,7 @@ void DialogStyleManager::OnCopyToStorage (wxCommandEvent &) { for (list::iterator style = Store.style.begin(); style != Store.style.end(); ++style) { if ((*style)->name.CmpNoCase(styleName) == 0) { addStyle = false; - if (wxYES == wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current storage. Proceed and overwrite anyway?",styleName.c_str()), "Style name collision.", wxYES_NO)) { + if (wxYES == wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current storage. Proceed and overwrite anyway?",styleName), "Style name collision.", wxYES_NO)) { **style = *styleMap.at(selections[i]); copied.push_back(styleName); } @@ -578,7 +578,7 @@ void DialogStyleManager::OnCopyToCurrent (wxCommandEvent &) { for (std::vector::iterator style = styleMap.begin(); style != styleMap.end(); ++style) { if ((*style)->name.CmpNoCase(styleName) == 0) { addStyle = false; - if (wxYES == wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current script. Proceed and overwrite anyway?",styleName.c_str()), "Style name collision.", wxYES_NO)) { + if (wxYES == wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current script. Proceed and overwrite anyway?",styleName), "Style name collision.", wxYES_NO)) { **style = *styleStorageMap.at(selections[i]); copied.push_back(styleName); } @@ -879,7 +879,7 @@ void DialogStyleManager::OnCurrentImport(wxCommandEvent &) { // Check if there is already a style with that name int test = CurrentList->FindString(styles[selections[i]], false); if (test != wxNOT_FOUND) { - int answer = wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current script. Overwrite?",styles[selections[i]].c_str()),"Style name collision.",wxYES_NO); + int answer = wxMessageBox(wxString::Format("There is already a style with the name \"%s\" on the current script. Overwrite?",styles[selections[i]]),"Style name collision.",wxYES_NO); if (answer == wxYES) { // Overwrite modified = true; diff --git a/aegisub/src/dialog_version_check.cpp b/aegisub/src/dialog_version_check.cpp index d0cc6af3b..f9a192db0 100644 --- a/aegisub/src/dialog_version_check.cpp +++ b/aegisub/src/dialog_version_check.cpp @@ -342,7 +342,7 @@ void AegisubVersionCheckerThread::DoCheck() GetSVNRevision(), GetIsOfficialRelease()?1:0, GetOSShortName(), - GetSystemLanguage().c_str()); + GetSystemLanguage()); wxString path = base_updates_path + querystring; diff --git a/aegisub/src/ffmpegsource_common.cpp b/aegisub/src/ffmpegsource_common.cpp index 1d9e164dd..73246b2a7 100644 --- a/aegisub/src/ffmpegsource_common.cpp +++ b/aegisub/src/ffmpegsource_common.cpp @@ -159,12 +159,12 @@ int FFmpegSourceProvider::AskForTrackSelection(const std::map &Tra TypeName = _("audio"); for (std::map::const_iterator i = TrackList.begin(); i != TrackList.end(); i++) { - Choices.Add(wxString::Format(_("Track %02d: %s"), i->first, i->second.c_str())); + Choices.Add(wxString::Format(_("Track %02d: %s"), i->first, i->second)); TrackNumbers.push_back(i->first); } - int Choice = wxGetSingleChoiceIndex(wxString::Format(_("Multiple %s tracks detected, please choose the one you wish to load:"), TypeName.c_str()), - wxString::Format(_("Choose %s track"), TypeName.c_str()), Choices); + int Choice = wxGetSingleChoiceIndex(wxString::Format(_("Multiple %s tracks detected, please choose the one you wish to load:"), TypeName), + wxString::Format(_("Choose %s track"), TypeName), Choices); if (Choice < 0) return Choice; @@ -301,7 +301,7 @@ wxThread::ExitCode FFmpegSourceCacheCleaner::Entry() { wxString cachedirname = StandardPaths::DecodePath("?user/ffms2cache/"); wxDir cachedir; if (!cachedir.Open(cachedirname)) { - LOG_D("provider/ffmpegsource/cache") << "couldn't open cache directory " << cachedirname.c_str(); + LOG_D("provider/ffmpegsource/cache") << "couldn't open cache directory " << STD_STR(cachedirname); return (wxThread::ExitCode)1; } @@ -360,7 +360,7 @@ wxThread::ExitCode FFmpegSourceCacheCleaner::Entry() { int64_t fsize = i->second.GetSize().GetValue(); if (!wxRemoveFile(i->second.GetFullPath())) { - LOG_D("provider/ffmpegsource/cache") << "failed to remove file " << i->second.GetFullPath().c_str(); + LOG_D("provider/ffmpegsource/cache") << "failed to remove file " << STD_STR(i->second.GetFullPath()); continue; } cursize -= fsize; diff --git a/aegisub/src/frame_main.cpp b/aegisub/src/frame_main.cpp index acd88a2d1..c270d51b5 100644 --- a/aegisub/src/frame_main.cpp +++ b/aegisub/src/frame_main.cpp @@ -752,7 +752,7 @@ void FrameMain::OnSubtitlesOpen() { basepath = ""; } else { wxLogWarning("Automation Script referenced with unknown location specifier character.\nLocation specifier found: %s\nFilename specified: %s", - sfnamel.c_str(), sfnames.c_str()); + sfnamel, sfnames); continue; } wxFileName sfname(sfnames); @@ -762,7 +762,7 @@ void FrameMain::OnSubtitlesOpen() { context->local_scripts->Add(Automation4::ScriptFactory::CreateFromFile(sfnames, true)); } else { wxLogWarning("Automation Script referenced could not be found.\nFilename specified: %s%s\nSearched relative to: %s\nResolved filename: %s", - sfnamel.c_str(), sfnames.c_str(), basepath.c_str(), sfname.GetFullPath().c_str()); + sfnamel, sfnames, basepath, sfname.GetFullPath()); } } #endif diff --git a/aegisub/src/help_button.cpp b/aegisub/src/help_button.cpp index 4ccd8a5f7..432ab056b 100644 --- a/aegisub/src/help_button.cpp +++ b/aegisub/src/help_button.cpp @@ -99,7 +99,7 @@ void HelpButton::OpenPage(const wxString pageID) { docsPath.Replace("\\","/"); docsPath = "/" + docsPath; #endif - wxString path = wxString::Format("file://%s/%s.html",docsPath.c_str(),page.c_str()); + wxString path = wxString::Format("file://%s/%s.html",docsPath,page); wxLaunchDefaultBrowser(path); } } diff --git a/aegisub/src/main.cpp b/aegisub/src/main.cpp index 7ea847006..711d86b22 100644 --- a/aegisub/src/main.cpp +++ b/aegisub/src/main.cpp @@ -378,7 +378,7 @@ static void UnhandledExeception(bool stackWalk) { #endif // Inform user of crash. - wxMessageBox(wxString::Format(exception_message, filename.c_str()), _("Program error"), wxOK | wxICON_ERROR, NULL); + wxMessageBox(wxString::Format(exception_message, filename), _("Program error"), wxOK | wxICON_ERROR, NULL); } else if (LastStartupState) { #if wxUSE_STACKWALKER == 1 diff --git a/aegisub/src/mkv_wrap.cpp b/aegisub/src/mkv_wrap.cpp index 60e7bded6..badb94ac4 100644 --- a/aegisub/src/mkv_wrap.cpp +++ b/aegisub/src/mkv_wrap.cpp @@ -88,7 +88,7 @@ void MatroskaWrapper::Open(wxString filename,bool parse) { // Failed parsing if (!file) { delete input; - throw wxString("MatroskaParser error: " + wxString(err,wxConvUTF8)).c_str(); + throw wxString("MatroskaParser error: " + wxString(err,wxConvUTF8)); } // Parse diff --git a/aegisub/src/subs_edit_ctrl.cpp b/aegisub/src/subs_edit_ctrl.cpp index d5c67921a..0663f59d0 100644 --- a/aegisub/src/subs_edit_ctrl.cpp +++ b/aegisub/src/subs_edit_ctrl.cpp @@ -820,7 +820,7 @@ void SubsTextEditCtrl::OnContextMenu(wxContextMenuEvent &event) { // Build list wxMenu *subMenu = new wxMenu(); for (int i=0;iAppend(EDIT_MENU_SUGGESTIONS+i,sugs[i]); - menu.Append(-1,wxString::Format(_("Spell checker suggestions for \"%s\""),currentWord.c_str()), subMenu); + menu.Append(-1,wxString::Format(_("Spell checker suggestions for \"%s\""),currentWord), subMenu); } } diff --git a/aegisub/src/subtitle_format.cpp b/aegisub/src/subtitle_format.cpp index 9f01955c9..2e644a145 100644 --- a/aegisub/src/subtitle_format.cpp +++ b/aegisub/src/subtitle_format.cpp @@ -291,7 +291,7 @@ SubtitleFormat::FPSRational SubtitleFormat::AskForFPS(bool showSMPTE) { wxString vidFPS; if (context->FPS().IsVFR()) vidFPS = "VFR"; else vidFPS = wxString::Format("%.3f",context->FPS().FPS()); - choices.Add(wxString::Format("From video (%s)",vidFPS.c_str())); + choices.Add(wxString::Format("From video (%s)",vidFPS)); } // Standard FPS values diff --git a/aegisub/src/subtitle_format_encore.cpp b/aegisub/src/subtitle_format_encore.cpp index d80045979..dd7f92fdb 100644 --- a/aegisub/src/subtitle_format_encore.cpp +++ b/aegisub/src/subtitle_format_encore.cpp @@ -105,7 +105,7 @@ void EncoreSubtitleFormat::WriteFile(wxString _filename,wxString encoding) { AssDialogue *current = dynamic_cast(*cur); if (current && !current->Comment) { ++i; - file.WriteLineToFile(wxString::Format("%i %s %s %s", i, ft.FromAssTime(current->Start).c_str(), ft.FromAssTime(current->End).c_str(), current->Text.c_str())); + file.WriteLineToFile(wxString::Format("%i %s %s %s", i, ft.FromAssTime(current->Start), ft.FromAssTime(current->End), current->Text)); } } diff --git a/aegisub/src/subtitle_format_microdvd.cpp b/aegisub/src/subtitle_format_microdvd.cpp index df7591d29..59d64b55b 100644 --- a/aegisub/src/subtitle_format_microdvd.cpp +++ b/aegisub/src/subtitle_format_microdvd.cpp @@ -174,7 +174,7 @@ void MicroDVDSubtitleFormat::WriteFile(wxString filename,wxString encoding) { int start = rate->FrameAtTime(current->Start.GetMS(),agi::vfr::START); int end = rate->FrameAtTime(current->End.GetMS(),agi::vfr::END); - file.WriteLineToFile(wxString::Format("{%i}{%i}%s",start,end,current->Text.c_str())); + file.WriteLineToFile(wxString::Format("{%i}{%i}%s",start,end,current->Text)); } } diff --git a/aegisub/src/text_file_writer.cpp b/aegisub/src/text_file_writer.cpp index 3c2b4e834..d0a377e02 100644 --- a/aegisub/src/text_file_writer.cpp +++ b/aegisub/src/text_file_writer.cpp @@ -57,7 +57,7 @@ TextFileWriter::TextFileWriter(wxString const& filename, wxString encoding) , conv() { if (encoding.empty()) encoding = lagi_wxString(OPT_GET("App/Save Charset")->GetString()); if (encoding.Lower() != wxSTRING_ENCODING) - conv.reset(new agi::charset::IconvWrapper(wxSTRING_ENCODING, encoding.c_str(), true)); + conv.reset(new agi::charset::IconvWrapper(wxSTRING_ENCODING, encoding.utf8_str(), true)); // Write the BOM try { diff --git a/aegisub/src/utils.cpp b/aegisub/src/utils.cpp index 85aa9199b..206d6bb6e 100644 --- a/aegisub/src/utils.cpp +++ b/aegisub/src/utils.cpp @@ -437,7 +437,7 @@ void RestartAegisub() { char *bundle_path = agi::util::OSX_GetBundlePath(); char *support_path = agi::util::OSX_GetBundleSupportFilesDirectory(); if (!bundle_path || !support_path) return; // oops - wxString exec = wxString::Format("\"%s/MacOS/restart-helper\" /usr/bin/open -n \"%s\"'", wxString(support_path, wxConvUTF8).c_str(), wxString(bundle_path, wxConvUTF8).c_str()); + wxString exec = wxString::Format("\"%s/MacOS/restart-helper\" /usr/bin/open -n \"%s\"'", wxString(support_path, wxConvUTF8), wxString(bundle_path, wxConvUTF8)); LOG_I("util/restart/exec") << exec; wxExecute(exec); free(bundle_path); diff --git a/aegisub/src/video_context.cpp b/aegisub/src/video_context.cpp index a76e4c700..421836807 100644 --- a/aegisub/src/video_context.cpp +++ b/aegisub/src/video_context.cpp @@ -535,7 +535,7 @@ void VideoContext::LoadTimecodes(wxString filename) { config::mru->Remove("Timecodes", STD_STR(filename)); } catch (const agi::vfr::Error& e) { - wxLogError("Timecode file parse error: %s", e.GetMessage().c_str()); + wxLogError("Timecode file parse error: %s", e.GetMessage()); } } void VideoContext::SaveTimecodes(wxString filename) { @@ -571,12 +571,12 @@ void VideoContext::OnVideoError(VideoProviderErrorEvent const& err) { wxLogError( "Failed seeking video. The video file may be corrupt or incomplete.\n" "Error message reported: %s", - lagi_wxString(err.GetMessage()).c_str()); + lagi_wxString(err.GetMessage())); } void VideoContext::OnSubtitlesError(SubtitlesProviderErrorEvent const& err) { wxLogError( "Failed rendering subtitles. Error message reported: %s", - lagi_wxString(err.GetMessage()).c_str()); + lagi_wxString(err.GetMessage())); } void VideoContext::OnExit() { diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index eccf33414..55032b257 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -191,14 +191,14 @@ void VideoDisplay::UploadFrameData(FrameReadyEvent &evt) { "Failed to initialize video display. Closing other running " "programs and updating your video card drivers may fix this.\n" "Error message reported: %s", - err.GetMessage().c_str()); + err.GetMessage()); con->videoController->Reset(); } catch (const VideoOutRenderException& err) { wxLogError( "Could not upload video frame to graphics card.\n" "Error message reported: %s", - err.GetMessage().c_str()); + err.GetMessage()); } Render(); } @@ -258,14 +258,14 @@ catch (const VideoOutException &err) { wxLogError( "An error occurred trying to render the video frame on the screen.\n" "Error message reported: %s", - err.GetMessage().c_str()); + err.GetMessage()); con->videoController->Reset(); } catch (const OpenGlException &err) { wxLogError( "An error occurred trying to render visual overlays on the screen.\n" "Error message reported: %s", - err.GetMessage().c_str()); + err.GetMessage()); con->videoController->Reset(); } catch (const char *err) { diff --git a/aegisub/src/video_provider_yuv4mpeg.cpp b/aegisub/src/video_provider_yuv4mpeg.cpp index d5428e98a..75dfee062 100644 --- a/aegisub/src/video_provider_yuv4mpeg.cpp +++ b/aegisub/src/video_provider_yuv4mpeg.cpp @@ -255,7 +255,7 @@ void YUV4MPEGVideoProvider::ParseFileHeader(const std::vector& tags) { throw VideoOpenError("ParseFileHeader: invalid or unknown interlacing mode"); } else - LOG_D("provider/video/yuv4mpeg") << "Unparsed tag: " << tags[i].c_str(); + LOG_D("provider/video/yuv4mpeg") << "Unparsed tag: " << STD_STR(tags[i]); } // The point of all this is to allow multiple YUV4MPEG2 headers in a single file