]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_image.cpp
missing commit
[wxWidgets.git] / src / html / m_image.cpp
index 87aa320f80a392c70eb2c691fc00d08201df45ab..6394fa1b2bec48061ff04142f6f15e2a164c12b8 100644 (file)
@@ -676,16 +676,16 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
 
                 if (tag.HasParam(wxT("WIDTH")))
                 {
-                    wxString param = tag.GetParam(wxT("WIDTH"));
-                    wxSscanf(param.c_str(), wxT("%i"), &w);
-                    if (param.EndsWith(wxT("%"))) {
-                        if (w < 0)
-                            w = 0;
-                        else if (w > 100)
-                            w = 100;
-                        wpercent = true;
+                    if (tag.GetParamAsIntOrPercent(wxT("WIDTH"), &w, wpercent))
+                    {
+                        if (wpercent)
+                        {
+                            if (w < 0)
+                                w = 0;
+                            else if (w > 100)
+                                w = 100;
+                        }
                     }
-
                 }
 
                 if (tag.HasParam(wxT("HEIGHT")))