From: Václav Slavík Date: Wed, 2 Feb 2000 21:18:31 +0000 (+0000) Subject: fixed bug that caused assertion failure when printing HTML with images X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d13b68d2331b78aa1b7ffaa391a0ddbb982c098d fixed bug that caused assertion failure when printing HTML with images git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index cbf2b392b7..35165bb4f4 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -373,10 +373,10 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA") } wxHtmlImageCell *cel = NULL; if (str) { - cel = new wxHtmlImageCell(str, - (int)(m_WParser -> GetPixelScale() * (double)w), - (int)(m_WParser -> GetPixelScale() * (double)h), - al, mn); + int neww = (w == -1) ? -1 : (int)(m_WParser -> GetPixelScale() * (double)w), + newh = (h == -1) ? -1 : (int)(m_WParser -> GetPixelScale() * (double)h); + + cel = new wxHtmlImageCell(str, neww, newh, al, mn); cel -> SetLink(m_WParser -> GetLink()); m_WParser -> GetContainer() -> InsertCell(cel); delete str;