Adjust throwing of exceptions to the new style documented in exception.h.

(Good thing nothing is catching these yet, and it's the only case of "new style" exceptions being used.)

Originally committed to SVN as r3365.
This commit is contained in:
Niels Martin Hansen 2009-08-05 20:52:44 +00:00
parent c731a9b437
commit b6a63c15e6
2 changed files with 4 additions and 4 deletions

View File

@ -754,7 +754,7 @@ void AssDialogue::SetMarginString(const wxString origvalue,int which) {
if (value > 9999) value = 9999;
// Assign
if (which < 0 || which >= 4) throw new Aegisub::InvalidMarginIdError;
if (which < 0 || which >= 4) throw Aegisub::InvalidMarginIdError();
Margin[which] = value;
}
@ -766,7 +766,7 @@ void AssDialogue::SetMarginString(const wxString origvalue,int which) {
/// @return
///
wxString AssDialogue::GetMarginString(int which,bool pad) {
if (which < 0 || which >= 4) throw new Aegisub::InvalidMarginIdError;
if (which < 0 || which >= 4) throw Aegisub::InvalidMarginIdError();
int value = Margin[which];
if (pad) return wxString::Format(_T("%04i"),value);
else return wxString::Format(_T("%i"),value);

View File

@ -478,7 +478,7 @@ void AssStyle::UpdateData() {
/// @param which
///
void AssStyle::SetMarginString(const wxString str,int which) {
if (which < 0 || which >= 4) throw new Aegisub::InvalidMarginIdError;
if (which < 0 || which >= 4) throw Aegisub::InvalidMarginIdError();
if (!str.IsNumber()) throw _T("Invalid margin value");
long value;
str.ToLong(&value);
@ -495,7 +495,7 @@ void AssStyle::SetMarginString(const wxString str,int which) {
/// @return
///
wxString AssStyle::GetMarginString(int which) {
if (which < 0 || which >= 4) throw new Aegisub::InvalidMarginIdError;
if (which < 0 || which >= 4) throw Aegisub::InvalidMarginIdError();
wxString result = wxString::Format(_T("%04i"),Margin[which]);
return result;
}