From 39da0824d376b3c09d5ae6e3606824ae210c874a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 10 Sep 2014 16:52:04 +0000 Subject: [PATCH] Don't skip wxHtmlContainerCell layout, even when the width is 0. This ensures that wxHtmlContainerCell height is set to some reasonable value instead of 0 and fixes infinite loop which occurred in some circumstances in wxGTL when trying to allocate size for wxHtmlListBox as it oscillated between having a vertical scrollbar with bigger width and not having it with smaller width. The latter was wrong as decreasing the width to 0 didn't really obviate the need for the vertical scrollbar and was just an artefact due to not setting wxHtmlContainerCell height at all in this case. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/htmlcell.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index cdee47bb1d..dc3a4a93dd 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -741,17 +741,10 @@ void wxHtmlContainerCell::Layout(int w) // VS: Any attempt to layout with negative or zero width leads to hell, // but we can't ignore such attempts completely, since it sometimes - // happen (e.g. when trying how small a table can be). The best thing we - // can do is to set the width of child cells to zero + // happen (e.g. when trying how small a table can be), so use at least one + // pixel width, this will at least give us the correct height sometimes. if (w < 1) - { - m_Width = 0; - for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) - cell->Layout(0); - // this does two things: it recursively calls this code on all - // child contrainers and resets children's position to (0,0) - return; - } + w = 1; wxHtmlCell *nextCell; long xpos = 0, ypos = m_IndentTop;