X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6987a0c4809f2a87cba1a8d72bbd31f42bcbca3e..65669e3152f9d6d3bb77c31d4211a356fe089d56:/src/html/m_tables.cpp diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp index f50de26c79..c5d63e6020 100644 --- a/src/html/m_tables.cpp +++ b/src/html/m_tables.cpp @@ -282,14 +282,19 @@ void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag) if (wd[wd.length()-1] == wxT('%')) { - wxSscanf(wd.c_str(), wxT("%i%%"), &m_ColsInfo[c].width); - m_ColsInfo[c].units = wxHTML_UNITS_PERCENT; + if ( wxSscanf(wd.c_str(), wxT("%i%%"), &m_ColsInfo[c].width) == 1 ) + { + m_ColsInfo[c].units = wxHTML_UNITS_PERCENT; + } } else { - wxSscanf(wd.c_str(), wxT("%i"), &m_ColsInfo[c].width); - m_ColsInfo[c].width = (int)(m_PixelScale * (double)m_ColsInfo[c].width); - m_ColsInfo[c].units = wxHTML_UNITS_PIXELS; + long width; + if ( wd.ToLong(&width) ) + { + m_ColsInfo[c].width = (int)(m_PixelScale * (double)width); + m_ColsInfo[c].units = wxHTML_UNITS_PIXELS; + } } } }