check tables width parameter for invalid values
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -282,17 +282,22 @@ void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag)
|
|||||||
|
|
||||||
if (wd[wd.length()-1] == wxT('%'))
|
if (wd[wd.length()-1] == wxT('%'))
|
||||||
{
|
{
|
||||||
wxSscanf(wd.c_str(), wxT("%i%%"), &m_ColsInfo[c].width);
|
if ( wxSscanf(wd.c_str(), wxT("%i%%"), &m_ColsInfo[c].width) == 1 )
|
||||||
|
{
|
||||||
m_ColsInfo[c].units = wxHTML_UNITS_PERCENT;
|
m_ColsInfo[c].units = wxHTML_UNITS_PERCENT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxSscanf(wd.c_str(), wxT("%i"), &m_ColsInfo[c].width);
|
long width;
|
||||||
m_ColsInfo[c].width = (int)(m_PixelScale * (double)m_ColsInfo[c].width);
|
if ( wd.ToLong(&width) )
|
||||||
|
{
|
||||||
|
m_ColsInfo[c].width = (int)(m_PixelScale * (double)width);
|
||||||
m_ColsInfo[c].units = wxHTML_UNITS_PIXELS;
|
m_ColsInfo[c].units = wxHTML_UNITS_PIXELS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// spanning:
|
// spanning:
|
||||||
|
Reference in New Issue
Block a user