]> git.saurik.com Git - wxWidgets.git/commitdiff
don't return junk from wxHtmlTag::GetParamAsInt() if the parameter is not an integer...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 3 May 2008 00:39:44 +0000 (00:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 3 May 2008 00:39:44 +0000 (00:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmltag.cpp

index 46baaea4dff99ba03f15d31153e59eb563a73934..3369fc82c3cfa52d9991a12b14fc5eff0e02f2a2 100644 (file)
@@ -524,11 +524,15 @@ bool wxHtmlTag::GetParamAsColour(const wxString& par, wxColour *clr) const
 
 bool wxHtmlTag::GetParamAsInt(const wxString& par, int *clr) const
 {
-    if (!HasParam(par)) return false;
+    if ( !HasParam(par) )
+        return false;
+
     long i;
-    bool succ = GetParam(par).ToLong(&i);
+    if ( !GetParam(par).ToLong(&i) )
+        return false;
+
     *clr = (int)i;
-    return succ;
+    return true;
 }
 
 wxString wxHtmlTag::GetAllParams() const