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
This commit is contained in:
Vadim Zeitlin 2014-09-10 16:52:04 +00:00
parent 1addaeaa75
commit 39da0824d3

View File

@ -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;