]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed bug that caused assertion failure when printing HTML with images
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 2 Feb 2000 21:18:31 +0000 (21:18 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 2 Feb 2000 21:18:31 +0000 (21:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/m_image.cpp

index cbf2b392b759b29c56cd43f63340bb3e3d7a3dfb..35165bb4f44406f564b4fd74cf4885080371f520 100644 (file)
@@ -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;