From 8072d933e82f75a46b5ee3616a010c5c3452f1e9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 May 2008 00:40:29 +0000 Subject: [PATCH] don't return junk from wxHtmlTag::GetParamAsInt() if the parameter is not an integer [backport of r53432 from trunk] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/htmltag.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp index bcf337bc3b..96b0cee92a 100644 --- a/src/html/htmltag.cpp +++ b/src/html/htmltag.cpp @@ -452,11 +452,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