From 752523180790d5a0aee13c0bcf2cd8eed07f1a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 25 Sep 2008 17:19:30 +0000 Subject: [PATCH] fixed pagebreaks computation in tables (#9935, backport of r55505) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 4 ++++ src/html/m_layout.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index 5e417f3b1b..22439c6db6 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -91,6 +91,10 @@ Major new features in 2.8 release 2.8.10: ------- +All (GUI): + +- Fixed wxHTML's pagebreaks computation in tables (D.J.Stauffer) + All (Unix): - Return false from wxSingleInstanceChecker::IsAnotherRunning() if an error diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index 9073ffc9ec..5cb9daa70b 100644 --- a/src/html/m_layout.cpp +++ b/src/html/m_layout.cpp @@ -108,7 +108,12 @@ bool wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak, wxArrayInt& known_page // m_PosY is only the vertical offset from the parent. The pagebreak // required here is the total page offset, so m_PosY must be added // to the parent's offset and height. - int total_height = m_PosY + GetParent()->GetPosY() + GetParent()->GetHeight(); + int total_height = m_PosY; + for ( wxHtmlCell *parent = GetParent(); parent; parent = parent->GetParent() ) + { + total_height += parent->GetPosY(); + } + // Search the array of pagebreaks to see whether we've already set // a pagebreak here. The standard bsearch() function is appropriate