From 87be8ad3151c5eebe640071b4257cff1f5ba37e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 13 Apr 2008 12:29:53 +0000 Subject: [PATCH] fixed incorrect layout width caching in wxHtmlContainerCell (patch #1931479) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/html/htmlcell.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 199ed94c2f..e98ae23307 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -131,6 +131,7 @@ All (GUI): best size if needed. - Made wxSpinCtrl::Reparent() in MSW and generic versions (Angelo Mottola). - Fixed timing of malformed animated GIFs in wxHTML (Gennady Feller). +- Fixed incorrect layout width caching in wxHTML (Jeff Tupper). All (Unix): diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 73c7ba04e2..7ef655e2ce 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -750,7 +750,9 @@ void wxHtmlContainerCell::Layout(int w) { wxHtmlCell::Layout(w); - if (m_LastLayout == w) return; + if (m_LastLayout == w) + return; + m_LastLayout = 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 @@ -1006,8 +1008,6 @@ void wxHtmlContainerCell::Layout(int w) m_MaxTotalWidth += s_indent + ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight); MaxLineWidth += s_indent + ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight); if (m_Width < MaxLineWidth) m_Width = MaxLineWidth; - - m_LastLayout = w; } void wxHtmlContainerCell::UpdateRenderingStatePre(wxHtmlRenderingInfo& info,