From 7476dfd9c69260342e808754649a2e62ecacaaad Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 25 Oct 2011 01:16:56 +0000 Subject: [PATCH] Use GetScriptInfoAsInt in AssFile::GetResolution Originally committed to SVN as r5777. --- aegisub/src/ass_file.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index 8cb56d542..3aaa8cb9f 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -659,25 +659,8 @@ void AssFile::SetScriptInfo(wxString const& key, wxString const& value) { } void AssFile::GetResolution(int &sw,int &sh) { - wxString temp = GetScriptInfo("PlayResY"); - if (temp.IsEmpty() || !temp.IsNumber()) { - sh = 0; - } - else { - long templ; - temp.ToLong(&templ); - sh = templ; - } - - temp = GetScriptInfo("PlayResX"); - if (temp.IsEmpty() || !temp.IsNumber()) { - sw = 0; - } - else { - long templ; - temp.ToLong(&templ); - sw = templ; - } + sw = GetScriptInfoAsInt("PlayResX"); + sh = GetScriptInfoAsInt("PlayResY"); // Gabest logic? if (sw == 0 && sh == 0) {