From 18b92130b8a5faafd9a0bb47370766afda070d2c Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 14 Apr 2006 16:46:38 +0000 Subject: [PATCH] catch const wchar_t * Originally committed to SVN as r323. --- core/ass_file.cpp | 2 +- core/automation_gui.cpp | 2 +- core/dialog_export.cpp | 2 +- core/dialog_resample.cpp | 2 +- core/frame_main.cpp | 10 +++++----- core/frame_main_events.cpp | 2 +- core/main.cpp | 2 +- core/subtitle_format_ass.cpp | 2 +- core/video_provider.cpp | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/ass_file.cpp b/core/ass_file.cpp index 4fe7c6154..4a7859714 100644 --- a/core/ass_file.cpp +++ b/core/ass_file.cpp @@ -105,7 +105,7 @@ void AssFile::Load (const wxString _filename,const wxString charset) { } // String error - catch (wchar_t *except) { + catch (const wchar_t *except) { wxMessageBox(except,_T("Error loading file"),wxICON_ERROR | wxOK); ok = false; } diff --git a/core/automation_gui.cpp b/core/automation_gui.cpp index 6548a04c2..f5e10252e 100644 --- a/core/automation_gui.cpp +++ b/core/automation_gui.cpp @@ -185,7 +185,7 @@ void DialogAutomationManager::OnAdd(wxCommandEvent &event) catch (wxString &err) { wxMessageBox(wxString::Format(_T("Error loading Automation script %s:\r\n\r\n%s"), sfnames.c_str(), err.c_str()), _T("Error loading Automation script"), wxOK|wxICON_ERROR, this); } - catch (wchar_t *err) { + catch (const wchar_t *err) { wxMessageBox(wxString::Format(_T("Error loading Automation script %s:\r\n\r\n%s"), sfnames.c_str(), err), _T("Error loading Automation script"), wxOK|wxICON_ERROR, this); } catch (...) { diff --git a/core/dialog_export.cpp b/core/dialog_export.cpp index eae3190c2..3156a868d 100644 --- a/core/dialog_export.cpp +++ b/core/dialog_export.cpp @@ -192,7 +192,7 @@ void DialogExport::OnProcess(wxCommandEvent &event) { Export->GetOriginalSubs()->SetScriptInfo(_T("Export Encoding"), CharsetList->GetStringSelection()); Export->Export(filename, CharsetList->GetStringSelection()); } - catch (wchar_t *error) { + catch (const wchar_t *error) { wxString err(error); wxMessageBox(err, _T("Error exporting subtitles"), wxOK | wxICON_ERROR, this); } diff --git a/core/dialog_resample.cpp b/core/dialog_resample.cpp index 05d6d601b..cb33366c4 100644 --- a/core/dialog_resample.cpp +++ b/core/dialog_resample.cpp @@ -198,7 +198,7 @@ void DialogResample::OnResample (wxCommandEvent &event) { curDiag->ClearBlocks(); continue; } - catch (wchar_t *err) { + catch (const wchar_t *err) { wxLogMessage(err); } catch (wxString err) { diff --git a/core/frame_main.cpp b/core/frame_main.cpp index 3fc0f2d4b..d55ca01cb 100644 --- a/core/frame_main.cpp +++ b/core/frame_main.cpp @@ -515,7 +515,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) { SubsBox->LoadDefault(AssFile::top); } } - catch (wchar_t *err) { + catch (const wchar_t *err) { wxMessageBox(wxString(err), _T("Error"), wxOK | wxICON_ERROR, NULL); return; } @@ -593,7 +593,7 @@ bool FrameMain::SaveSubtitles(bool saveas,bool withCharset) { AssFile::top->Save(filename,true,true,charset); UpdateTitle(); } - catch (wchar_t *err) { + catch (const wchar_t *err) { wxMessageBox(wxString(err), _T("Error"), wxOK | wxICON_ERROR, NULL); return false; } @@ -873,7 +873,7 @@ void FrameMain::LoadVideo(wxString file,bool autoload) { } videoBox->videoDisplay->SetVideo(file); } - catch (wchar_t *error) { + catch (const wchar_t *error) { wxString err(error); wxMessageBox(err, _T("Error opening video file"), wxOK | wxICON_ERROR, this); } @@ -921,7 +921,7 @@ void FrameMain::LoadAudio(wxString filename,bool FromVideo) { audioBox->SetFile(filename,FromVideo); SetDisplayMode(-1); } - catch (wchar_t *error) { + catch (const wchar_t *error) { wxString err(error); wxMessageBox(err, _T("Error opening audio file"), wxOK | wxICON_ERROR, this); } @@ -947,7 +947,7 @@ void FrameMain::LoadVFR(wxString filename) { SubsBox->Refresh(false); } // Fail - catch (wchar_t *error) { + catch (const wchar_t *error) { wxString err(error); wxMessageBox(err, _T("Error opening timecodes file"), wxOK | wxICON_ERROR, this); } diff --git a/core/frame_main_events.cpp b/core/frame_main_events.cpp index 5afaff4de..83665337e 100644 --- a/core/frame_main_events.cpp +++ b/core/frame_main_events.cpp @@ -1064,7 +1064,7 @@ void FrameMain::OnAutoSave(wxTimerEvent &event) { catch (wxString err) { StatusTimeout(_T("Exception when attempting to autosave file: ") + err); } - catch (wchar_t *err) { + catch (const wchar_t *err) { StatusTimeout(_T("Exception when attempting to autosave file: ") + wxString(err)); } catch (...) { diff --git a/core/main.cpp b/core/main.cpp index 74405a320..7c6465550 100644 --- a/core/main.cpp +++ b/core/main.cpp @@ -114,7 +114,7 @@ bool AegisubApp::OnInit() { SetTopWindow(frame); } - catch (wchar_t *err) { + catch (const wchar_t *err) { wxMessageBox(err,_T("Fatal error while initializing")); return false; } diff --git a/core/subtitle_format_ass.cpp b/core/subtitle_format_ass.cpp index 846b415f5..748c08787 100644 --- a/core/subtitle_format_ass.cpp +++ b/core/subtitle_format_ass.cpp @@ -79,7 +79,7 @@ void ASSSubtitleFormat::ReadFile(wxString filename,wxString encoding) { try { lasttime = AddLine(wxbuffer,curgroup,lasttime,IsSSA); } - catch (wchar_t *err) { + catch (const wchar_t *err) { Clear(); throw wxString(_T("Error processing line: ")) + wxbuffer + _T(": ") + wxString(err); } diff --git a/core/video_provider.cpp b/core/video_provider.cpp index db139c773..4b1ce174c 100644 --- a/core/video_provider.cpp +++ b/core/video_provider.cpp @@ -73,7 +73,7 @@ VideoProvider *VideoProvider::GetProvider(wxString video,wxString subtitles) { } // Catch error - catch (wchar_t *err) { + catch (const wchar_t *err) { error = err; } catch (...) {