X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9915cdc960ad954c3a61758fc4a53e83435fa59e..12bb29f5432174ecbd65549bda832d70d34a98ae:/src/html/m_image.cpp diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index df6295ecc7..6394fa1b2b 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -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);