catch const wchar_t *

Originally committed to SVN as r323.
This commit is contained in:
David Lamparter 2006-04-14 16:46:38 +00:00
parent 7d31182c59
commit 18b92130b8
9 changed files with 13 additions and 13 deletions

View File

@ -105,7 +105,7 @@ void AssFile::Load (const wxString _filename,const wxString charset) {
} }
// String error // String error
catch (wchar_t *except) { catch (const wchar_t *except) {
wxMessageBox(except,_T("Error loading file"),wxICON_ERROR | wxOK); wxMessageBox(except,_T("Error loading file"),wxICON_ERROR | wxOK);
ok = false; ok = false;
} }

View File

@ -185,7 +185,7 @@ void DialogAutomationManager::OnAdd(wxCommandEvent &event)
catch (wxString &err) { 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); 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); 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 (...) { catch (...) {

View File

@ -192,7 +192,7 @@ void DialogExport::OnProcess(wxCommandEvent &event) {
Export->GetOriginalSubs()->SetScriptInfo(_T("Export Encoding"), CharsetList->GetStringSelection()); Export->GetOriginalSubs()->SetScriptInfo(_T("Export Encoding"), CharsetList->GetStringSelection());
Export->Export(filename, CharsetList->GetStringSelection()); Export->Export(filename, CharsetList->GetStringSelection());
} }
catch (wchar_t *error) { catch (const wchar_t *error) {
wxString err(error); wxString err(error);
wxMessageBox(err, _T("Error exporting subtitles"), wxOK | wxICON_ERROR, this); wxMessageBox(err, _T("Error exporting subtitles"), wxOK | wxICON_ERROR, this);
} }

View File

@ -198,7 +198,7 @@ void DialogResample::OnResample (wxCommandEvent &event) {
curDiag->ClearBlocks(); curDiag->ClearBlocks();
continue; continue;
} }
catch (wchar_t *err) { catch (const wchar_t *err) {
wxLogMessage(err); wxLogMessage(err);
} }
catch (wxString err) { catch (wxString err) {

View File

@ -515,7 +515,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
SubsBox->LoadDefault(AssFile::top); SubsBox->LoadDefault(AssFile::top);
} }
} }
catch (wchar_t *err) { catch (const wchar_t *err) {
wxMessageBox(wxString(err), _T("Error"), wxOK | wxICON_ERROR, NULL); wxMessageBox(wxString(err), _T("Error"), wxOK | wxICON_ERROR, NULL);
return; return;
} }
@ -593,7 +593,7 @@ bool FrameMain::SaveSubtitles(bool saveas,bool withCharset) {
AssFile::top->Save(filename,true,true,charset); AssFile::top->Save(filename,true,true,charset);
UpdateTitle(); UpdateTitle();
} }
catch (wchar_t *err) { catch (const wchar_t *err) {
wxMessageBox(wxString(err), _T("Error"), wxOK | wxICON_ERROR, NULL); wxMessageBox(wxString(err), _T("Error"), wxOK | wxICON_ERROR, NULL);
return false; return false;
} }
@ -873,7 +873,7 @@ void FrameMain::LoadVideo(wxString file,bool autoload) {
} }
videoBox->videoDisplay->SetVideo(file); videoBox->videoDisplay->SetVideo(file);
} }
catch (wchar_t *error) { catch (const wchar_t *error) {
wxString err(error); wxString err(error);
wxMessageBox(err, _T("Error opening video file"), wxOK | wxICON_ERROR, this); 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); audioBox->SetFile(filename,FromVideo);
SetDisplayMode(-1); SetDisplayMode(-1);
} }
catch (wchar_t *error) { catch (const wchar_t *error) {
wxString err(error); wxString err(error);
wxMessageBox(err, _T("Error opening audio file"), wxOK | wxICON_ERROR, this); wxMessageBox(err, _T("Error opening audio file"), wxOK | wxICON_ERROR, this);
} }
@ -947,7 +947,7 @@ void FrameMain::LoadVFR(wxString filename) {
SubsBox->Refresh(false); SubsBox->Refresh(false);
} }
// Fail // Fail
catch (wchar_t *error) { catch (const wchar_t *error) {
wxString err(error); wxString err(error);
wxMessageBox(err, _T("Error opening timecodes file"), wxOK | wxICON_ERROR, this); wxMessageBox(err, _T("Error opening timecodes file"), wxOK | wxICON_ERROR, this);
} }

View File

@ -1064,7 +1064,7 @@ void FrameMain::OnAutoSave(wxTimerEvent &event) {
catch (wxString err) { catch (wxString err) {
StatusTimeout(_T("Exception when attempting to autosave file: ") + 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)); StatusTimeout(_T("Exception when attempting to autosave file: ") + wxString(err));
} }
catch (...) { catch (...) {

View File

@ -114,7 +114,7 @@ bool AegisubApp::OnInit() {
SetTopWindow(frame); SetTopWindow(frame);
} }
catch (wchar_t *err) { catch (const wchar_t *err) {
wxMessageBox(err,_T("Fatal error while initializing")); wxMessageBox(err,_T("Fatal error while initializing"));
return false; return false;
} }

View File

@ -79,7 +79,7 @@ void ASSSubtitleFormat::ReadFile(wxString filename,wxString encoding) {
try { try {
lasttime = AddLine(wxbuffer,curgroup,lasttime,IsSSA); lasttime = AddLine(wxbuffer,curgroup,lasttime,IsSSA);
} }
catch (wchar_t *err) { catch (const wchar_t *err) {
Clear(); Clear();
throw wxString(_T("Error processing line: ")) + wxbuffer + _T(": ") + wxString(err); throw wxString(_T("Error processing line: ")) + wxbuffer + _T(": ") + wxString(err);
} }

View File

@ -73,7 +73,7 @@ VideoProvider *VideoProvider::GetProvider(wxString video,wxString subtitles) {
} }
// Catch error // Catch error
catch (wchar_t *err) { catch (const wchar_t *err) {
error = err; error = err;
} }
catch (...) { catch (...) {