diff --git a/aegisub/src/ass_style.cpp b/aegisub/src/ass_style.cpp index 7abb19436..4682799d7 100644 --- a/aegisub/src/ass_style.cpp +++ b/aegisub/src/ass_style.cpp @@ -290,19 +290,19 @@ AssStyle::AssStyle(wxString rawData,int version) { } // Read left margin - SetMarginString(get_next_string(tkn), 0); + Margin[0] = mid(0, get_next_int(tkn), 9999); // Read right margin - SetMarginString(get_next_string(tkn), 1); + Margin[1] = mid(0, get_next_int(tkn), 9999); // Read top margin - SetMarginString(get_next_string(tkn), 2); + Margin[2] = mid(0, get_next_int(tkn), 9999); // Read bottom margin if (version == 2) - SetMarginString(get_next_string(tkn),3); + Margin[3] = mid(0, get_next_int(tkn), 9999); else - SetMarginString(GetMarginString(2), 3); + Margin[3] = Margin[2]; // Skip alpha level if (version == 0) @@ -343,23 +343,6 @@ void AssStyle::UpdateData() { SetEntryData(final); } -void AssStyle::SetMarginString(const wxString str,int which) { - if (which < 0 || which >= 4) throw Aegisub::InvalidMarginIdError(); - if (!str.IsNumber()) throw "Invalid margin value"; - long value; - str.ToLong(&value); - if (value < 0) value = 0; - else if (value > 9999) value = 9999; - - Margin[which] = value; -} - -wxString AssStyle::GetMarginString(int which) const { - if (which < 0 || which >= 4) throw Aegisub::InvalidMarginIdError(); - wxString result = wxString::Format("%04i",Margin[which]); - return result; -} - wxString AssStyle::GetSSAText() const { wxString output; int align = 0; diff --git a/aegisub/src/ass_style.h b/aegisub/src/ass_style.h index 0101c25b6..5b822b882 100644 --- a/aegisub/src/ass_style.h +++ b/aegisub/src/ass_style.h @@ -103,15 +103,6 @@ public: /// Update the raw line data after one or more of the public members have been changed void UpdateData(); - /// Returns the margin value as a string - /// @param which 0: left; 1: right; 2: vertical/top; 3: bottom - wxString GetMarginString(int which) const; - - /// Sets margin value from a string - /// @param value New value for the margin; must contain a number - /// @param which 0: left; 1: right; 2: vertical/top; 3: bottom - void SetMarginString(const wxString value, int which); - /// @brief Get a list of valid ASS font encodings static void GetEncodings(wxArrayString &encodingStrings);