don't generate an endless stream of asserts for the 0-sized images
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -385,6 +385,8 @@ wxHtmlImageCell::wxHtmlImageCell(wxWindow *window, wxFSFile *input,
|
||||
m_physX = m_physY = -1;
|
||||
#endif
|
||||
|
||||
if ( m_bmpW && m_bmpH )
|
||||
{
|
||||
if ( input )
|
||||
{
|
||||
wxInputStream *s = input->GetStream();
|
||||
@@ -425,7 +427,9 @@ wxHtmlImageCell::wxHtmlImageCell(wxWindow *window, wxFSFile *input,
|
||||
if ( readImg )
|
||||
#endif // wxUSE_GIF && wxUSE_TIMER
|
||||
{
|
||||
SetImage(wxImage(*s, wxBITMAP_TYPE_ANY));
|
||||
wxImage image(*s, wxBITMAP_TYPE_ANY);
|
||||
if ( image.Ok() )
|
||||
SetImage(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -444,6 +448,8 @@ wxHtmlImageCell::wxHtmlImageCell(wxWindow *window, wxFSFile *input,
|
||||
}
|
||||
m_bitmap = new wxBitmap(broken_image_xpm);
|
||||
}
|
||||
}
|
||||
//else: ignore the 0-sized images used sometimes on the Web pages
|
||||
|
||||
m_Width = (int)(scale * (double)m_bmpW);
|
||||
m_Height = (int)(scale * (double)m_bmpH);
|
||||
|
Reference in New Issue
Block a user