]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_image.cpp
missing commit
[wxWidgets.git] / src / html / m_image.cpp
index df6295ecc75ec0715d52546634e689002bd3be9b..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")))
@@ -718,6 +718,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
                                           m_WParser->GetPixelScale(),
                                           al, mn);
                 m_WParser->ApplyStateToCell(cel);
+                m_WParser->StopCollapsingSpaces();
                 cel->SetId(tag.GetParam(wxT("id"))); // may be empty
                 cel->SetAlt(tag.GetParam(wxT("alt")));
                 m_WParser->GetContainer()->InsertCell(cel);